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)setVehicleStatebagProperties
Applies saved Mechanic properties from a trusted server integration and persists them for the vehicle.
-- server only; run after your own server-side permission or payment checks
-- vehicle: number - the server vehicle entity, not a network ID
-- props: table - only include the properties you want to update
-- Example: record a lighting controller installed by your server integration
local updated = exports["jg-mechanic"]:setVehicleStatebagProperties(vehicle, {
lcInstalled = true
})| Returns | Type | Description |
|---|---|---|
updated | boolean | Whether the vehicle and properties were accepted |
This export is not a client event. Don't pass unchecked client properties into it. The older client export with this name restores the vehicle's saved server data; it no longer accepts new tuning, servicing or nitrous values from the client.
doesVehicleNeedServicing
Returns whether a vehicle needs servicing.
-- server only
-- plate: string
local needsService = exports["jg-mechanic"]:doesVehicleNeedServicing(plate)| Returns | Type | Description |
|---|---|---|
needsService | boolean | Whether 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,
},
...
}
]]| Returns | Type | Description |
|---|---|---|
history | table[] | One record per service, newest first - see the example result shape |
Last updated 5 October 2026