Commands#
Player commands work for anyone where they make sense. Creator commands need admin or a Config.CreatorJobs job. Admin commands need the framework's admin group: ESX admin / superadmin, QBCore god / admin.
Command | Who | Description |
|---|---|---|
| Garage owner | Management of the private garage you stand in: give keys, key holders, sell. |
| Garage owner | Decoration mode inside your private garage. |
| Everyone | Turns the garage music on or off for you. |
|
| Opens the impound form for the nearest car: lot, time, fee, pay-to-release and note. |
| Job members | At your job garage: add the car you own and sit in to the job's fleet, or remove one from it. |
| Creator | Create, edit, delete and teleport to garages. |
| Creator | The Furniture Creator. The name is |
| Admin | Gives a car to a player; it is delivered to the impound. Without a plate a random one is made. |
| Admin | Registers the car you are sitting in to that player. |
| Admin or impound job | Sends the nearest owned car to the impound (a job car back to its job garage). Use it instead of |
| Admin or console | Sends every persistent car with nobody at the wheel to the impound. |
| Admin, ACE or job | Instant full repair of the car you are in or next to. Access is set in |
| Admin | Teleports you to where a persistent car was last seen. |
| Console | Re-adds the default garages that were deleted. Existing garages are not touched. |
| Console | Moves every car stored in a garage that no longer exists to the impound of its type. |
Giving /repairvehicle to a staff group through ACE:
add_ace group.admin qs-advancedgarages.repairvehicle allowClient Exports#
For opening garages from your own scripts — a phone app, a radial entry, a housing door — and reading what exists.
Opening and closing a garage
-- Open the garage menu of a garage by name
exports['qs-advancedgarages']:OpenGarageMenu('Legion Square', false) -- (garage, isImpound)
-- Aircraft garages and impounds open as a list
exports['qs-advancedgarages']:OpenPlaneGarageList('Airport Hangar')
-- Close the menu and put the player back
exports['qs-advancedgarages']:closeMenu()
-- true while the player is in a garage menu or inside a garage interior
local busy = exports['qs-advancedgarages']:usingGarages()Combine OpenGarageMenu with the creator's Allow open garage menu switch turned off to open a garage only from your own script.
Reading garages
-- Every garage, as plain tables. true also includes the job garages.
local garages = exports['qs-advancedgarages']:GetAllGarages(true)
for name, garage in pairs(garages) do
print(name, garage.type, garage.isJobGarage, garage.coords.menuCoords.x)
end
-- Only the garages this player owns
local mine = exports['qs-advancedgarages']:GetGarages()
-- Sell one of them (as the Sell button does)
exports['qs-advancedgarages']:SellGarage('Del Perro Private')GetAllGaragesPlainData is the same as GetAllGarages.
Impounding from your own script
-- The same as /impound, without the job check
exports['qs-advancedgarages']:ImpoundVehicle()
-- Only the form: returns what the officer filled in, or nil if cancelled
local form = exports['qs-advancedgarages']:OpenImpoundForm('vehicle') -- or an entity, 'boat', 'plane'
if form then
-- form = { garage, price, time, getByPay, note }
TriggerServerEvent('my-mdt:impound', plate, form) -- then call the server export impound()
endRepairing
exports['qs-advancedgarages']:RepairNearestVehicle() -- the car you are in or next to
exports['qs-advancedgarages']:RepairSpecificVehicle('ABC123') -- by exact plate textBoth clear the saved dents too, so the repair survives storing the car.
Decoration and interiors
-- Is the player decorating right now?
local decorating = exports['qs-advancedgarages']:inDecorate()
-- Add a piece to a furniture category from another resource
exports['qs-advancedgarages']:AddFurniture('sofa', {
object = 'prop_couch_01', label = 'Leather Couch', price = 1500,
img = 'https://...', description = 'Comfortable',
})
-- Add a shell model to the list the creator offers
exports['qs-advancedgarages']:AddShell({ model = 'my_garage_shell' })A temporary garage at runtime
exports['qs-advancedgarages']:CreateGarage('event-parking', {
type = 'vehicle',
available = true,
coords = {
menuCoords = vector3(832.22, -1264.15, 26.29),
spawnCoords = vector4(832.22, -1264.15, 26.29, 180.0),
},
})The garage exists until the next restart and is not written to the database. For a permanent garage use /garagecreator.
Server Exports#
How another resource drives the garages: an MDT that impounds, a reward that hands out a car, a script that spawns owned vehicles or changes their plate.
impound
Impounds an owned car that is out in the world. Every option is optional.
local ok, garage = exports['qs-advancedgarages']:impound(plate, {
garage = 'Hayes Autos', -- an impound of the vehicle's type; default: Config.DefaultImpounds / nearest
price = 1500, -- release fee
time = 30 * 60, -- seconds before it can be released
getByPay = true, -- may pay to release before the time ends
note = 'Illegally parked', -- shown to the owner
source = officerId, -- officer to notify and log
})
if not ok then print('Could not impound', plate) endIt refuses a plate that nobody owns, or a car that is not out.
GiveVehicle
Does what /givecar does, on behalf of an admin source.
-- (admin source, { target id, model, plate? }, 'vehicle' | 'boat' | 'plane')
exports['qs-advancedgarages']:GiveVehicle(source, { targetId, 'sultan', 'GIFT01' }, 'vehicle')SpawnVehicle
Spawns an owned vehicle as a persistent car, finds a free spot near the coordinates and hands over the keys.
-- (vehicle row id, owner identifier, type, coords vec4, props, source?, warp?, exactCoords?)
local data = exports['qs-advancedgarages']:SpawnVehicle(row.id, row.owner, 'vehicle', coords, props, source, true)
-- data = { id, type, entity, netID, vehicle, plate, owner }Persistence
For vehicle shops and scripts that spawn owned cars on their own:
-- Make an existing, owned, networked car persistent
exports['qs-advancedgarages']:setVehicleToPersistent(netId)
-- Save and remove it: into a garage, or to the impound when no garage is given
exports['qs-advancedgarages']:removeVehicleFromPersistent(plate, 'Legion Square')
-- Forget and delete the entity without touching the database
exports['qs-advancedgarages']:dropPersistentEntity(plate)
-- Replace its saved properties (the whole table)
exports['qs-advancedgarages']:updatePersistentVehicleProps(plate, props)
-- Change the plate of a persistent car, on the car and in the database
exports['qs-advancedgarages']:updateVehiclePlate(oldPlate, newPlate)
-- /mdv on behalf of a player (same job/admin check)
exports['qs-advancedgarages']:deleteVehicle(source)Insurance
local insured = exports['qs-advancedgarages']:IsVehicleInsured(plate) -- true / false
local policy = exports['qs-advancedgarages']:GetVehicleInsurance(plate)
-- policy = { tier = 'kasko', owner, expiresAt, autoRenew } or nilReading garages
local garages = exports['qs-advancedgarages']:GetAllGarages(true) -- true includes job garages
local impounds = exports['qs-advancedgarages']:getImpoundGarages() -- only impoundsEvents#
Event | Side | Use |
|---|---|---|
| Server, listen | Fired with |
| Client, trigger | Stores the car the player is in, in the garage they stand in. |
| Client, trigger | Used by housing scripts to give a house its garage and tell the garages who holds the key. |
Exports that take a plate expect it exactly as it is saved. Trim it first if it comes from
GetVehicleNumberPlateText, which pads plates with spaces.



