Skip to main content

Exports

Call the exports on exports.road_garage. Plates are matched without regard to case or leading and trailing spaces. For events after every action, see the hooks.

Garages

RegisterGarage

Adds or replaces a garage at runtime, for example a house garage from your housing script. Server.
string
required
Unique garage id, up to 64 characters. Vehicles parked here are stored under it.
table
required
boolean
true when the garage was added.

RemoveGarage

Removes a garage added with RegisterGarage. Garages from config.lua cannot be removed. Server.
string
required
boolean

Vehicles

GetVehicle

string
required
table | nil

StoreVehicle

Parks a vehicle that is out but no longer exists in the world, or that is impounded, in a garage. Server.
string
required
string
required
boolean
false when the vehicle is already parked, still drives around, or the garage does not exist.

IsVehicleOut

string
required
boolean
true while the vehicle is out and exists in the world.

ImpoundVehicle

Impounds a vehicle, for parking tickets or police scripts. A vehicle in the world is removed. Server.
string
required
table
boolean
false when the vehicle does not exist, is already impounded or the lot does not exist.

Keys

AddKeyHolder

Gives a player access to a vehicle as if the owner had shared it. Server.
string
required
string
required
Framework identifier of the player
string
Shown in the owner’s key list
boolean

RemoveKeyHolder

string
required
string
required
boolean

Mileage

GetMileage

string
required
table | nil
{ mileage, serviceIn } in Config.Mileage.Unit.

ServiceVehicle

Marks a vehicle as serviced at its current mileage, for mechanic scripts. Server.
string
required
boolean

Phone apps

RoadPhone’s Garage app uses these exports. Server.

GetPlayerVehicles

number
required
Player server id
table | nil
{ vehicles, unit }, or nil while RoadGarage starts. Each vehicle has plate, model, modelName, nickname, status (stored, out, lost, impounded), garage, garageLabel, access (owner or shared), fuel, engine, body, odometer, coords (while out) and impound (while impounded).

GetAccess

number
required
string
required
string | nil
owner or shared when the player may use the vehicle, otherwise nil.

DeliverVehicle

Takes a parked land vehicle of the player (owner or key holder) out of its garage and spawns it at a point, for a valet service. Distance and payment are the caller’s job.
number
required
string
required
vector4
required
Where the vehicle spawns
string
Spawn type hint, for example automobile or bike; the type saved with the vehicle wins
table
{ ok = true, netId }, or { ok = false, error } with an error such as impounded, already_out, lost or bad_coords.

Client

OpenGarage

Opens a garage’s screen for the local player, for example from your own interaction. The server still checks access and distance.
string
required

OpenImpound

string
required

StoreVehicle

Parks the vehicle the local player is driving in the given garage.
string
required

CloseGarage

Closes the garage screen.