Skip to Content
Cobalt

cobalt_garages

Garages and the impound.

ImpoundVehicle

Server

Sends an owned vehicle to the default impound; true when it was impounded.

exports.cobalt_garages:ImpoundVehicle(plate, reason, fee, by)
ParameterTypeOptionalDescription
platestringNo
reasonstringYesdefault 'Impounded'
feeintegerYesdefault from config
bystringYesdefault 'City'
ReturnsDescription
boolean
Example
local ok = exports.cobalt_garages:ImpoundVehicle(
    'COBALT01',
    'Parking in a red zone',
    250,
    'ABC12345'
)

SpawnVehicle

Server

Spawns an owned vehicle that is out of its garage (state = 0) at coords, seats its owner source in it with keys and tracks it like a garage takeout. Returns the entity, or nil when the row is not out, belongs to someone else, is already in the world or failed to spawn.

exports.cobalt_garages:SpawnVehicle(source, plate, coords, vehicleType)
ParameterTypeOptionalDescription
sourceintegerNo
platestringNo
coordsvector4No
vehicleTypestringYesdefault 'automobile', used when the vehicle has never been parked
ReturnsDescription
integer?
Example
local value = exports.cobalt_garages:SpawnVehicle(
    source,
    'COBALT01',
    vector4(215.8, -810.1, 30.7, 90.0),
    'vehicleType'
)

On this page