Exports
Exports documented currently for Wasabi Garage Creator (wasabi_garage).
Server exports are trusted: they do not check the permissions of a calling player, so only call them from your own server code.
Client Exports
Garages
OpenGarage
Open a garage's showroom from your own script, for example a job garage. The player does not need to stand at the menu point, but the garage's job access still applies.
exports['wasabi_garage']:OpenGarage(data)
| Parameter | Type | Required | Description |
|---|---|---|---|
data.id | number|string | Yes | Garage id, or the Script key set in the creator (for example 'police'). |
data.coords | vector4 | No | Spawn the taken-out car here instead of at the garage's spawn points. Must be within 60 m of where the menu was opened. |
exports['wasabi_garage']:OpenGarage({ id = 'police', coords = vector4(441.0, -1013.0, 28.6, 90.0) })
IsShowroomOpen
local open = exports['wasabi_garage']:IsShowroomOpen()
Returns: boolean — true while the showroom menu is open.
GetGarages
Every garage synced to this client.
local garages = exports['wasabi_garage']:GetGarages()
Returns: table[] — { id, label, type, access, menu, spawns, zone, interior, storageFee, price, jobs, flags } per garage. type is 'car', 'boat' or 'air'; access is 'public', 'private' or 'impound'.
StoreCurrentVehicle
Park the vehicle the player is driving in the garage whose parking zone (or spawn point) it is in. Same checks and fees as the park prompt.
local started = exports['wasabi_garage']:StoreCurrentVehicle()
Returns: boolean — false when the player is not in a vehicle or not at a garage they can park in. The result of the park itself is shown as a notification.
Walk-in interiors
EnterGarageInterior
Walk into a garage's interior. The player must be within 10 m of the garage's menu point and on foot.
exports['wasabi_garage']:EnterGarageInterior(garageId)
| Parameter | Type | Required | Description |
|---|---|---|---|
garageId | number | Yes | Garage id. |
LeaveGarageInterior
Leave the current interior on foot, back to the garage door.
exports['wasabi_garage']:LeaveGarageInterior()
DriveOutOfInterior
Drive the vehicle the player sits in out of the interior, like pressing E.
exports['wasabi_garage']:DriveOutOfInterior()
IsInGarageInterior
local inside = exports['wasabi_garage']:IsInGarageInterior()
Returns: boolean
GetInteriorCars
local cars = exports['wasabi_garage']:GetInteriorCars()
Returns: table|nil — cars in the current interior keyed by network id ({ plate, hash, tag, tagColor, fuel, engine, body, mileage, ownerName?, display? }), or nil when not inside. display = true marks a locked car the player cannot drive.
Impound
OpenImpoundForm
Open the officer impound form for a vehicle. Players outside impound.jobs get an error from the server.
exports['wasabi_garage']:OpenImpoundForm(vehicle?)
| Parameter | Type | Required | Description |
|---|---|---|---|
vehicle | number | No | Vehicle entity. Defaults to the closest vehicle within 5 m. |
Server Exports
Garages
GetGarage
local garage = exports['wasabi_garage']:GetGarage(id)
| Parameter | Type | Required | Description |
|---|---|---|---|
id | number | Yes | Garage id. |
Returns: table|nil — { id, label, type, access, coords = { menuCoords, spawnCoords } }. menuCoords and spawnCoords (the first spawn point) are vector3.
GetGarages
local garages = exports['wasabi_garage']:GetGarages()
Returns: table[] — every garage, in the same shape as GetGarage.
GetImpoundLots
local lots = exports['wasabi_garage']:GetImpoundLots()
Returns: table[] — impound lots only, in the same shape as GetGarage.
Vehicles
GiveVehicle
Give a vehicle to an online player, stored in a garage. Same as /givecar.
local plate, garageId = exports['wasabi_garage']:GiveVehicle(target, model, plate?, garageId?)
| Parameter | Type | Required | Description |
|---|---|---|---|
target | number | Yes | Server id of the new owner. |
model | string | Yes | Vehicle spawn name. |
plate | string | No | Plate (upper-cased). A random free plate is generated when omitted. |
garageId | number | No | Garage to store it in. Defaults to the first public car garage. |
Returns: string, number? — the plate and garage id, or nil and a reason (no_player, plate_taken, db_error).
Pass garageId for boats and aircraft. Without it, the vehicle is stored in the first public car garage, where boats and aircraft are not listed.
RepairVehicle
Repair a garage vehicle and clear its saved damage. Same as /garagerepair.
local ok = exports['wasabi_garage']:RepairVehicle(plate)
| Parameter | Type | Required | Description |
|---|---|---|---|
plate | string | Yes | Plate. |
Returns: boolean — false when the plate is not an owned vehicle.
Impound
ImpoundVehicle
Impound a vehicle by plate. Also available as impound. The live vehicle is removed and the owner is notified.
local ok, result = exports['wasabi_garage']:ImpoundVehicle(plate, opts?)
| Parameter | Type | Required | Description |
|---|---|---|---|
plate | string | Yes | Plate. |
opts.lotId | number | No | Impound lot id. Defaults to the first impound lot. |
opts.minutes | number | No | Hold time (0 to impound.maxMinutes). Default 0. |
opts.fee | number | No | Release fine (0 to impound.maxFee). Default 0. |
opts.payToRelease | boolean | No | false: the owner must wait out the hold time before paying. Default true. |
opts.note | string | No | Note shown on the ticket (up to 255 characters). |
opts.reason | string | No | 'police' (default), 'destroyed', 'lost', 'restart', 'sold' or 'admin'. |
opts.officer | number | No | Server id of the officer, shown on the ticket. |
opts.entity | number | No | The vehicle entity, if you already have it. |
opts.force | boolean | No | Impound even when a player is inside. |
Returns: boolean, number|string — true and the impound record id, true, 'unowned' when the plate is not an owned vehicle (the entity is just deleted), or false and a reason (bad_request, occupied, no_lot, busy, db_error).
Housing
Use these from your housing script to give each property its own private garage. Character ids are the framework character identifier (citizenid on Qbox and QBCore, identifier on ESX, charId on OX).
CreateHouseGarage
local garageId = exports['wasabi_garage']:CreateHouseGarage(data)
| Parameter | Type | Required | Description |
|---|---|---|---|
data.menu | vector4 | Yes | Menu point. |
data.label | string | No | Default 'House Garage'. |
data.type | string | No | 'car' (default), 'boat' or 'air'. |
data.spawns | vector4[] | No | Spawn points. Defaults to the menu point. |
data.interior | string | No | Interior preset key ('garage_2', 'garage_6', 'garage_10'). |
data.owner | string|number | No | Owner character id. |
data.houseId | any | No | Your property id, stored with the garage. |
data.hideBlip | boolean | No | Hide the blip. |
Returns: number|nil — the new garage id.
SetGarageOwner
Set (or clear) the owner of a private garage. Cars of players who lose access are moved out (see private.guestFallback).
local ok = exports['wasabi_garage']:SetGarageOwner(garageId, charId?)
Returns: boolean
SetGarageKeyHolders
Replace the key holder list of a garage.
local ok = exports['wasabi_garage']:SetGarageKeyHolders(garageId, { charId1, charId2 })
Returns: boolean
AddGarageKey
local ok = exports['wasabi_garage']:AddGarageKey(garageId, charId)
Returns: boolean
RemoveGarageKey
Removes the key and moves that player's cars out of the garage.
local removed = exports['wasabi_garage']:RemoveGarageKey(garageId, charId)
Returns: boolean — true if the key existed.
RemoveHouseGarage
Delete a house garage. The owner's cars parked there go to the impound lot (free to release), key holders' cars follow private.guestFallback, and its furniture and keys are removed.
local ok = exports['wasabi_garage']:RemoveHouseGarage(garageId)
Returns: boolean