JG Docs
Mechanic

Exports

Server Exports

vehiclePlateUpdated

Tells JG Mechanic a vehicle's plate has changed. Run this export in all scripts that update plates, otherwise you'll lose your vehicle's data.

-- server only
-- plate: string - the current plate
-- newPlate: string - the new plate
exports["jg-mechanic"]:vehiclePlateUpdated(plate, newPlate)

doesVehicleNeedServicing

Returns whether a vehicle needs servicing.

-- server only
-- plate: string
local needsService = exports["jg-mechanic"]:doesVehicleNeedServicing(plate)
ReturnsTypeDescription
needsServicebooleanWhether the vehicle needs servicing

getVehicleServiceHistory

Returns the service history for a specific vehicle.

-- server only
-- plate: string
local history = exports["jg-mechanic"]:getVehicleServiceHistory(plate)

--[[ example result:
{
  {
    id = 1,
    date = 1710000000,
    identifier = "license:...",
    plate = "ABC 123",
    mechanic_label = "LS Customs",
    serviced_paort = "engine_oil",
    mechanic = "license:...",
    mileage_km = 4200,
  },
  ...
}
]]
ReturnsTypeDescription
historytable[]One record per service, newest first - see the example result shape

On this page