Server Exports
All exports are available server-side from any resource:
exports.zephyr_garages:ExportName(...)GetGarages
Returns the full table of all currently registered garages, keyed by garage name.
local garages = exports.zephyr_garages:GetGarages()
for name, garage in pairs(garages) do
print(name, garage.label, garage.vehicleType)
endReturns: table<string, GarageConfig> — all garages registered at the time of the call.
RegisterGarage
Registers a new garage or updates an existing one at runtime. After registration, all connected clients automatically receive the new access points and blips — no restart required.
exports.zephyr_garages:RegisterGarage('sandy_pd', {
label = 'Sandy PD',
vehicleType = 'car',
groups = 'police',
accessPoints = {
{
blip = { name = 'Sandy PD Garage', sprite = 357, color = 38 },
coords = vec4(1853.06, 3686.55, 34.27, 210.0),
spawn = vec4(1857.33, 3690.12, 34.27, 28.0),
},
},
})| Parameter | Type | Description |
|---|---|---|
name | string | Unique garage identifier (used as table key) |
garageConfig | table | Garage configuration — same structure as config.server.garages entries |
garageConfig fields:
| Field | Type | Description |
|---|---|---|
label | string | Display name shown in the UI |
vehicleType | string | "car", "air", "sea", or "all" |
type | string | (optional) "depot" to make this an impound/depot garage |
groups | string|table | (optional) Job name(s) required to access this garage |
shared | boolean | (optional) If true, all players with access see all vehicles |
skipGarageCheck | boolean | (optional) If true, shows all owned vehicles regardless of which garage they are stored at |
states | table | (optional) Vehicle states to show (default: { GARAGED }) |
allowedIdentifiers | table | (optional) Array of citizen IDs with explicit access |
spawnerVehicles | table | (optional) Array of model names for spawner mode |
spawnerVehicleConfigs | table | (optional) Per-model config for spawner (minJobGrade, livery, extras) |
spawnerVehicleFolders | table | (optional) Map of { [modelName] = folderId } for spawner folder assignment |
showLiveriesExtrasMenu | boolean | (optional) Show livery/extras selector before spawning |
accessPoints | table | Array of access point definitions (see below) |
Access point definition:
{
blip = { name = 'Garage', sprite = 357, color = 44 },
coords = vec4(x, y, z, heading), -- interaction point
spawn = vec4(x, y, z, heading), -- vehicle spawn point
-- spawn can be a table of vec4 for multiple spawn candidates
}Fires
zephyr_garages:server:garageRegisteredon the server andzephyr_garages:client:garageRegistered/garageUpdatedon all clients.
SetGarageAllowedIdentifiers
Updates the allowed identifiers (citizen IDs) for a garage without re-registering it. Useful for job-assignment or instance-based access that changes at runtime.
local success = exports.zephyr_garages:SetGarageAllowedIdentifiers('private_hangar', {
'ABC123', -- citizenid of player 1
'DEF456', -- citizenid of player 2
})| Parameter | Type | Description |
|---|---|---|
name | string | Garage identifier key |
identifiers | table | Array of citizen IDs that should have access. Pass an empty table to allow all. |
Returns: boolean — true if the garage was found and updated, false if the garage does not exist.
Fires
zephyr_garages:client:garageAccessUpdatedon all clients.
SetVehicleGarage
Moves a vehicle record to a specific garage in the database, updating its state to GARAGED (or IMPOUNDED if the target is a depot). Use this to impound or relocate a vehicle from another resource.
local ok, err = exports.zephyr_garages:SetVehicleGarage(vehicleId, 'pillbox_impound')
if not ok then
print('Failed: ' .. err.message)
end| Parameter | Type | Description |
|---|---|---|
vehicleId | number | Database ID of the vehicle (from qbx_vehicles) |
garageName | string | Target garage identifier key |
Returns: true on success, or false, { code, message } on failure.
Error codes:
| Code | Description |
|---|---|
"not_found" | The target garage does not exist |
"no_rows_changed" | No database row was updated (vehicle ID not found) |
Example — impound a vehicle from a police stop:
-- After seizing a vehicle, move it to the impound depot
local ok = exports.zephyr_garages:SetVehicleGarage(targetVehicleId, 'pillbox_impound')
if ok then
TriggerClientEvent('ox_lib:notify', officerSrc, {
type = 'success',
description = 'Vehicle impounded.'
})
endSetVehicleDepotPrice
Sets the release fee for a vehicle in the depot/impound. The fee is paid by the owner when they retrieve the vehicle.
local ok, err = exports.zephyr_garages:SetVehicleDepotPrice(vehicleId, 5000)| Parameter | Type | Description |
|---|---|---|
vehicleId | number | Database ID of the vehicle |
depotPrice | number | Release fee in dollars |
Returns: true on success, or false, { code, message } on failure.
Example — set a custom impound fee when seizing a vehicle:
-- Calculate 5% of vehicle value as impound fee
local vehicleInfo = exports.qbx_core:GetVehiclesByName()[modelName]
local fee = math.floor((vehicleInfo and vehicleInfo.price or 0) * 0.05)
exports.zephyr_garages:SetVehicleGarage(vehicleId, 'pillbox_impound')
exports.zephyr_garages:SetVehicleDepotPrice(vehicleId, fee)