Server
Server Net Events
ak47_garage:addgarage
Inserts a newly created garage into the ak47_garage database table and broadcasts the garage to all connected clients.
TriggerServerEvent('ak47_garage:addgarage', gid, name, polyzone, spawns, setting, reposition, trailerpos)Parameters
gid
string
Yes
Unique garage identifier.
name
string
Yes
Display name of the garage.
polyzone
table
Yes
PolyZone points and height boundaries ({points, minZ, maxZ}).
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 & trailer parking spot coordinates.
ak47_garage:updatesettting
Updates existing garage settings in the database and synchronizes the change to all online clients.
TriggerServerEvent('ak47_garage:updatesettting', gid, setting)Parameters
gid
string
Yes
Garage identifier.
setting
table
Yes
Updated settings table.
ak47_garage:remove
Deletes a garage and all associated RealParking records from the database and syncs deletion to all clients.
Parameters
gid
string
Yes
Garage identifier to remove.
ak47_garage:spawnvehicle
Spawns a vehicle server-side, sets the number plate, deducts parking fees if applicable, sets stored = 0 in the database, puts the player in the vehicle, and synchronizes with the client.
Parameters
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 vehicle was retrieved.
fee
number
Yes
Accumulated parking fee to charge.
ak47_garage:unrealparking
Stores a vehicle into a standard garage, validates ownership, deletes the world entity, removes persistence records, and updates database records with vehicle properties and current timestamp.
Parameters
nid
number
Yes
Network ID of the vehicle.
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.
ak47_garage:setstate
Generic event to update vehicle stored state in the framework database.
Parameters
plate
string
Yes
Vehicle license plate.
state
number
Yes
0 = Out, 1 = Stored, 2 = Impounded.
depotprice
number
No
Optional impound depot price (QBCore / QBX).
ak47_garage:saveVehicleImage
Saves the FiveManage image URL of a vehicle photo into the database image column.
Parameters
plate
string
Yes
Vehicle license plate.
url
string
Yes
FiveManage hosted image URL.
ak47_garage:saveModelStats
Inserts or updates pre-calculated vehicle performance stats in the ak47_vehicle_stats database cache.
ak47_garage:realparking:clear
Clears real-parked data and despawns the visual dummy for a specific vehicle plate.
ak47_garage:realparking:unpark_local
Unparks a real-parked dummy vehicle, deletes the dummy on all clients, creates an active network vehicle at the parking spot, applies mods, and sets stored = 0.
ak47_garage:persistent:updateState
Dispatched from client periodically or upon exiting the driver seat to save vehicle location, damage, fuel, engine status, locks, and extended metrics into world persistence.
ak47_garage:persistent:reportSubmerged
Dispatched when a vehicle is detected submerged in water or destroyed, immediately triggering auto-impound.
Server Callbacks
Registered via Lib47.Callback for client-server RPC requests.
ak47_garage:getvehicles
Returns all owned vehicles for the invoking player with real-time status and calculated parking fees.
ak47_garage:getvehiclestats
Queries the server cache and returns cached performance stats for an array of vehicle models.
ak47_garage:locatevehicle
Deducts the GPS location fee (Config.LocateVehicleFee) and marks the vehicle on the player's minimap if active in the world.
ak47_garage:getrescues
Retrieves all active pending vehicle rescue operations from the server.
ak47_garage:rescuevehicle
Initiates a rescue operation for a stranded vehicle at an impound garage. Deducts the rescue fee, despawns active entities, and either rescues instantly or starts a countdown timer (Config.RescueVehicle.Timer).
ak47_garage:transfer:garage
Deducts the destination garage transfer fee and transfers the vehicle to the new garage location.
ak47_garage:payimpound
Deducts the impound release fee, despawns active/persistent entities, clears timers, and sets stored = 1 in the target impound garage.
ak47_garage:canpark
Checks if a standard garage has capacity available when enableparkinglimit is enabled.
ak47_garage:canpark:real
Checks if a RealParking garage has capacity available.
ak47_garage:canpark:housing
Checks if a house garage has capacity available based on Config.HousingGarageLimit.
ak47_garage:pay:real
Calculates and deducts the accumulated real-parking hourly fee when unparking a vehicle from a RealParking dummy spot.
ak47_garage:updatename
Saves a custom vehicle display nickname to the database (customname column).
ak47_garage:transferOwnership
Transfers ownership of a vehicle from the sender to the target player server ID.
ak47_garage:getmods
Retrieves saved vehicle modifications from the framework database for a vehicle plate.
VehiclePlateChanged
Server event to notify ak47_garage that a vehicle's license plate has been modified by an external resource. Updates server entity plate, persistence caches, database tables, and broadcasts the plate update to all connected clients.
Parameters
oldPlate
string
Yes
Previous vehicle license plate.
newPlate
string
Yes
New vehicle license plate.
Example
Last updated