JG Docs
Advanced Garages

Exports

Server Exports

getAllGarages

Returns information on all garages.

-- server only
local garages = exports["jg-advancedgarages"]:getAllGarages()

--[[ example result:
{
  {
    name = "legion",
    label = "Legion Square",
    type = "public",
    vehicle = "car",
    blipName = "Public Garage",
    blipColor = 3,
    blipNumber = 357,
    showBlip = true,
    takeVehicle = vector3(215.9, -810.1, 30.7),
    putVehicle = vector3(228.8, -800.1, 30.6),
    spawnPoint = vector4(229.7, -810.0, 30.6, 157.5),
  },
  ...
}
]]
ReturnsTypeDescription
garagestable[]One entry per garage - see the example result shape

registerVehicleOutside

Available in v3.2.5 and later

Registers a vehicle as outside the garage and currently spawned, so the vehicle cannot be respawned. This prevents vehicle duplication. Useful for integrating with scripts that also spawn vehicles from the garage, such as a valet.

-- server only
-- plate: string
-- netId: integer - the network ID of the vehicle (not the entity id!)
exports["jg-advancedgarages"]:registerVehicleOutside(plate, netId)

deleteOutsideVehicle

Available in v3.2.5 and later

Deletes a vehicle via its plate if the vehicle is registered as outside within JG Advanced Garages - either via interacting with a garage directly or by using the registerVehicleOutside export.

-- server only
-- plate: string
exports["jg-advancedgarages"]:deleteOutsideVehicle(plate)

On this page