For the complete documentation index, see llms.txt. This page is also available as Markdown.

Client

Housing Events

These client-side events enable seamless integration with housing and property scripts (such as ps-housing, qb-houses, ox_property, bcs_housing, etc.).

ak47_garage:housing:takevehicle

Opens the Garage UI for a house garage. It displays all compatible player-owned vehicles, suppresses transfer fees, and sets the vehicle spawn point directly at the player's current location/heading.

TriggerEvent('ak47_garage:housing:takevehicle', gid, garagetype)

Parameters

Parameter
Type
Required
Description

gid

string

Yes

Unique identifier for the house garage (e.g. "property_42" or "house_vinewood").

garagetype

string

Yes

Vehicle category allowed for this house garage: "car", "boat", "heli", or "plane".

Integration Example

-- In your housing / property script when interacting with house garage marker
local houseId = "house_104"
local garageType = "car"

RegisterNetEvent('myHousing:openGarage', function(houseId)
    TriggerEvent('ak47_garage:housing:takevehicle', houseId, 'car')
end)

ak47_garage:housing:storevehicle

Stores the vehicle the player is currently sitting in into a house garage. Enforces the housing vehicle capacity limit configured in Config.HousingGarageLimit and checks trailer compatibility.

Parameters

Parameter
Type
Required
Description

gid

string

Yes

Unique identifier for the house garage.

garagetype

string

Yes

Vehicle category for this house garage ("car", "boat", "heli", "plane").

Integration Example


UI & HUD Integration Events

These events are dispatched when the garage UI opens or closes. Third-party UI and HUD scripts (like ak47_hud or custom minimap scripts) can listen to these events to toggle radar/HUD elements.

ak47_garage:OnGarageUiOpen

Triggered immediately when the Garage NUI UI and 3D showroom camera are activated.

Parameters

Parameter
Type
Description

garageId

string

The ID of the garage being opened.


ak47_garage:OnGarageUiClose

Triggered immediately when the Garage UI is closed and the showroom camera is destroyed.

Parameters

Parameter
Type
Description

garageId

string

The ID of the garage that was closed.

Vehicle Spawning & Management

ak47_garage:spawnvehicle

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

Parameters

Parameter
Type
Description

nid

number

Network ID of the spawned vehicle entity.

properties

table

Vehicle modifications and properties table.

pos

vector4

Spawn coordinates and heading {x, y, z, w}.

trailerData

table|nil

Optional trailer vehicle properties table.

plate

string

Vehicle license plate.

realparking

boolean|nil

true if spawning from a RealParking unpark action.


ak47_garage:client:applyModsWithTargetPlayer

Applies vehicle modifications when the vehicle's network owner is another nearby client.


ak47_garage:removekey

Triggered to remove the physical vehicle key from the player upon parking the vehicle.


ak47_garage:markmap

Sets a GPS waypoint on the player's minimap and displays an information or warning notification.

Parameters

Parameter
Type
Description

pos

vector3

Coordinates to place waypoint on.

msg

string

Notification message text.

msgType

string

Notification type ("info", "error", "success").


Persistent Vehicles Events

ak47_garage:persistent:applyProperties

Applies saved properties, body damage, door/window status, engine status, indicators, handbrake, roof state, dirt, and lock states to a persistent vehicle spawned dynamically by the server.

Parameters

Parameter
Type
Description

netId

number

Network ID of the vehicle entity.

mods

table

Vehicle properties / modifications table.

damage

table

Visual damage table (doors, tires, windows, engine, body).

status

table

Extended status (engineOn, lightState, handbrake, roofState, dirtLevel, radioStation, doorslocked).

fuel

number

Fuel percentage (0 - 100).

locked

number

Door lock value (1 = unlocked, 2 = locked).

Last updated