Client

Client-side events for ak47_garage.

Housing Events

ak47_garage:housing:takevehicle

Opens the garage interface for a housing garage.

TriggerEvent('ak47_garage:housing:takevehicle', gid, garagetype)
Parameter Type Required Description
gid string Yes Unique house garage identifier
garagetype string Yes Vehicle category (car, boat, heli, plane)

ak47_garage:housing:storevehicle

Stores the current vehicle into a housing garage.

TriggerEvent('ak47_garage:housing:storevehicle', gid, garagetype)
Parameter Type Required Description
gid string Yes Unique house garage identifier
garagetype string Yes Vehicle category (car, boat, heli, plane)

UI Events

ak47_garage:OnGarageUiOpen

Triggered when the garage NUI menu and showroom camera open.

AddEventHandler('ak47_garage:OnGarageUiOpen', function(garageId)
    DisplayRadar(false)
end)
Parameter Type Required Description
garageId string Yes Opened garage identifier

ak47_garage:OnGarageUiClose

Triggered when the garage NUI menu closes and showroom camera is destroyed.

AddEventHandler('ak47_garage:OnGarageUiClose', function(garageId)
    DisplayRadar(true)
end)
Parameter Type Required Description
garageId string Yes Closed garage identifier

Vehicle Management

ak47_garage:spawnvehicle

Dispatched from server to finalize client vehicle setup upon garage retrieval.

RegisterNetEvent('ak47_garage:spawnvehicle', function(nid, properties, pos, trailerData, plate, realparking)
Parameter Type Required Description
nid number Yes Vehicle entity network ID
properties table Yes Vehicle properties and modifications
pos vector4 Yes Spawn coordinates and heading
trailerData table | nil No Optional trailer properties table
plate string Yes Vehicle license plate
realparking boolean | nil No True if unparking from RealParking dummy

ak47_garage:client:applyModsWithTargetPlayer

Applies vehicle modifications when network owner is another client.

RegisterNetEvent('ak47_garage:client:applyModsWithTargetPlayer', function(nid, properties)
Parameter Type Required Description
nid number Yes Vehicle entity network ID
properties table Yes Vehicle modifications table

ak47_garage:removekey

Triggered to remove the physical vehicle key upon parking.

RegisterNetEvent('ak47_garage:removekey', function(plate, model)
Parameter Type Required Description
plate string Yes Vehicle license plate
model number | string Yes Vehicle model hash or name

ak47_garage:markmap

Sets a GPS waypoint on the minimap and displays a notification.

RegisterNetEvent('ak47_garage:markmap', function(pos, msg, msgType)
Parameter Type Required Description
pos vector3 Yes Map waypoint coordinates
msg string Yes Notification message text
msgType string Yes Notification type (info, error, success)

Persistent Vehicles

ak47_garage:persistent:applyProperties

Applies saved properties, damage, status, and lock state to a persistent vehicle.

RegisterNetEvent('ak47_garage:persistent:applyProperties', function(netId, mods, damage, status, fuel, locked)
Parameter Type Required Description
netId number Yes Vehicle entity network ID
mods table Yes Vehicle modifications table
damage table Yes Visual and mechanical damage table
status table Yes Extended status table
fuel number Yes Fuel level percentage (0-100)
locked number Yes Door lock state (1 = unlocked, 2 = locked)