Server-side events and callbacks for ak47_garage.
Inserts a newly created garage into the database and syncs to online clients.
TriggerServerEvent('ak47_garage:addgarage', gid, name, polyzone, spawns, setting, reposition, trailerpos)| Parameter | Type | Required | Description |
|---|---|---|---|
gid |
string | Yes | Unique garage identifier |
name |
string | Yes | Display name of the garage |
polyzone |
table | Yes | PolyZone points and height boundaries |
spawns |
table | Yes | Array of spawn points {x, y, z, w} |
setting |
table | Yes | Garage settings object |
reposition |
vector4 | No | Boat respawn point for boat garages |
trailerpos |
vector4 | No | Truck and trailer parking spot coordinates |
Updates existing garage settings in the database and synchronizes changes across clients.
TriggerServerEvent('ak47_garage:updatesettting', gid, setting)| Parameter | Type | Required | Description |
|---|---|---|---|
gid |
string | Yes | Garage identifier |
setting |
table | Yes | Updated settings table |
Deletes a garage and associated RealParking records from the database and clients.
TriggerServerEvent('ak47_garage:remove', gid)| Parameter | Type | Required | Description |
|---|---|---|---|
gid |
string | Yes | Garage identifier to delete |
Spawns a vehicle server-side, updates database stored state, and places player inside.
TriggerServerEvent('ak47_garage:spawnvehicle', pos, model, plate, type, gid, fee)| Parameter | Type | Required | Description |
|---|---|---|---|
pos |
vector4 | Yes | Spawn position and heading {x, y, z, w} |
model |
number | string | Yes | Vehicle model hash or name |
plate |
string | Yes | Vehicle license plate |
type |
string | Yes | Vehicle category type |
gid |
string | Yes | Garage identifier where retrieved |
fee |
number | Yes | Accumulated parking fee to charge |
Stores a vehicle into standard garage storage, deletes world entity, and updates database.
TriggerServerEvent('ak47_garage:unrealparking', nid, mods, plate, gid, trailer)| Parameter | Type | Required | Description |
|---|---|---|---|
nid |
number | Yes | Vehicle entity network ID |
mods |
table | Yes | Vehicle modifications table |
plate |
string | Yes | Vehicle license plate |
gid |
string | Yes | Target garage ID |
trailer |
table | nil | No | Optional trailer properties table |
Updates stored state of a vehicle in the framework database.
TriggerServerEvent('ak47_garage:setstate', plate, state, depotprice)| Parameter | Type | Required | Description |
|---|---|---|---|
plate |
string | Yes | Vehicle license plate |
state |
number | Yes | 0 = Out, 1 = Stored, 2 = Impounded |
depotprice |
number | No | Impound depot price |
Saves the FiveManage hosted image URL of a vehicle into the database.
TriggerServerEvent('ak47_garage:saveVehicleImage', plate, url)| Parameter | Type | Required | Description |
|---|---|---|---|
plate |
string | Yes | Vehicle license plate |
url |
string | Yes | Hosted image URL |
Updates pre-calculated vehicle performance stats in the database cache.
TriggerServerEvent('ak47_garage:saveModelStats', modelKey, stats)| Parameter | Type | Required | Description |
|---|---|---|---|
modelKey |
string | number | Yes | Vehicle model name or hash |
stats |
table | Yes | Performance statistics table |
Clears real-parked data and despawns visual dummy for a plate.
TriggerServerEvent('ak47_garage:realparking:clear', gid, plate)| Parameter | Type | Required | Description |
|---|---|---|---|
gid |
string | Yes | Garage identifier |
plate |
string | Yes | Vehicle license plate |
Unparks a real-parked dummy vehicle, creates active network vehicle, and applies mods.
TriggerServerEvent('ak47_garage:realparking:unpark_local', gid, plate, pos, modelHash)| Parameter | Type | Required | Description |
|---|---|---|---|
gid |
string | Yes | Garage identifier |
plate |
string | Yes | Vehicle license plate |
pos |
vector4 | Yes | Vehicle spawn coordinates |
modelHash |
number | Yes | Vehicle model hash |
Saves vehicle location, damage, fuel, engine status, and locks into world persistence.
TriggerServerEvent('ak47_garage:persistent:updateState', plate, pos, mods, damage, status, fuel, locked)| Parameter | Type | Required | Description |
|---|---|---|---|
plate |
string | Yes | Vehicle license plate |
pos |
vector4 | Yes | Vehicle coordinates and heading |
mods |
table | Yes | Vehicle modifications table |
damage |
table | Yes | Body and engine damage table |
status |
table | Yes | Extended vehicle status table |
fuel |
number | Yes | Fuel level percentage |
locked |
number | Yes | Door lock status |
Dispatched when a vehicle is submerged or destroyed to trigger auto-impound.
TriggerServerEvent('ak47_garage:persistent:reportSubmerged', plate)| Parameter | Type | Required | Description |
|---|---|---|---|
plate |
string | Yes | Vehicle license plate |
Notifies the garage system that a vehicle plate has been updated externally.
TriggerServerEvent('ak47_garage:server:VehiclePlateChanged', oldPlate, newPlate)| Parameter | Type | Required | Description |
|---|---|---|---|
oldPlate |
string | Yes | Previous vehicle license plate |
newPlate |
string | Yes | New vehicle license plate |
Returns all owned vehicles for invoking player with status and fees.
local vehicles = Lib47.Callback.Await('ak47_garage:getvehicles', nil)table - Array of player-owned vehicle records.Queries the server cache and returns cached performance stats for model list.
local statsMap = Lib47.Callback.Await('ak47_garage:getvehiclestats', nil, uniqueModelsList)| Parameter | Type | Required | Description |
|---|---|---|---|
uniqueModelsList |
table | Yes | Array of vehicle model names or hashes |
table - Map of vehicle statistics keyed by model.Deducts GPS locate fee and marks vehicle coordinates on minimap.
local success = Lib47.Callback.Await('ak47_garage:locatevehicle', nil, plate)| Parameter | Type | Required | Description |
|---|---|---|---|
plate |
string | Yes | Vehicle license plate |
boolean - true if vehicle located, false otherwise.Retrieves all active pending vehicle rescue operations from server.
local rescues = Lib47.Callback.Await('ak47_garage:getrescues', nil)table - Active rescue entries keyed by plate.Initiates rescue operation for stranded vehicle at impound lot.
local success, result = Lib47.Callback.Await('ak47_garage:rescuevehicle', nil, plate, gid)| Parameter | Type | Required | Description |
|---|---|---|---|
plate |
string | Yes | Vehicle license plate |
gid |
string | Yes | Target impound garage identifier |
boolean, any - Success flag and status result.Transfers vehicle to a new garage and charges transfer fee.
local success = Lib47.Callback.Await('ak47_garage:transfer:garage', nil, plate, newGarageId)| Parameter | Type | Required | Description |
|---|---|---|---|
plate |
string | Yes | Vehicle license plate |
newGarageId |
string | Yes | Destination garage identifier |
boolean - true if transferred, false otherwise.Deducts impound fee and stores vehicle into specified impound garage.
local success = Lib47.Callback.Await('ak47_garage:payimpound', nil, gid, plate, fee)| Parameter | Type | Required | Description |
|---|---|---|---|
gid |
string | Yes | Impound garage identifier |
plate |
string | Yes | Vehicle license plate |
fee |
number | Yes | Impound release fee |
boolean - true if payment succeeded, false otherwise.Checks if a standard garage has capacity available.
local canPark = Lib47.Callback.Await('ak47_garage:canpark', nil, gid)| Parameter | Type | Required | Description |
|---|---|---|---|
gid |
string | Yes | Garage identifier |
boolean - true if garage has capacity, false otherwise.Checks if a RealParking garage has capacity available.
local canPark = Lib47.Callback.Await('ak47_garage:canpark:real', nil, gid)| Parameter | Type | Required | Description |
|---|---|---|---|
gid |
string | Yes | Garage identifier |
boolean - true if RealParking has capacity, false otherwise.Checks if a house garage has capacity available.
local canPark = Lib47.Callback.Await('ak47_garage:canpark:housing', nil, gid)| Parameter | Type | Required | Description |
|---|---|---|---|
gid |
string | Yes | House garage identifier |
boolean - true if house garage has capacity, false otherwise.Deducts accumulated hourly parking fee when unparking from RealParking dummy.
local success = Lib47.Callback.Await('ak47_garage:pay:real', nil, gid, plate)| Parameter | Type | Required | Description |
|---|---|---|---|
gid |
string | Yes | Garage identifier |
plate |
string | Yes | Vehicle license plate |
boolean - true if paid successfully, false otherwise.Saves a custom vehicle nickname to the database.
local success = Lib47.Callback.Await('ak47_garage:updatename', nil, plate, customName)| Parameter | Type | Required | Description |
|---|---|---|---|
plate |
string | Yes | Vehicle license plate |
customName |
string | Yes | New vehicle display nickname |
boolean - true if nickname saved, false otherwise.Transfers vehicle ownership from sender to target player server ID.
local success, message = Lib47.Callback.Await('ak47_garage:transferOwnership', nil, plate, targetServerId)| Parameter | Type | Required | Description |
|---|---|---|---|
plate |
string | Yes | Vehicle license plate |
targetServerId |
number | Yes | Target player server ID |
boolean, string - Success flag and status message.Retrieves saved vehicle modifications from database for a vehicle plate.
local mods = Lib47.Callback.Await('ak47_garage:getmods', nil, plate)| Parameter | Type | Required | Description |
|---|---|---|---|
plate |
string | Yes | Vehicle license plate |
table - Saved vehicle modifications table.