Browse docs
Server: GetVehicleMileage(plate)
Reference for Server: GetVehicleMileage(plate) in mechanicjob.
This page documents supported public integration calls and usage examples. It does not expose or reproduce the resource's internal implementation.
Server Exports
All Advanced Pricing and Billing exports return a result table:
{
success = true,
data = {}
}
Rejected requests return success = false and a stable error code. Player identity, mechanic job, grade, permissions, vehicle distance, configured limits, quote state, invoice ownership, and monetary values are always resolved or validated on the server.
GetVehicleMileage(plate)
- Purpose: Returns mileage in kilometres from the selected source for the supplied plate. With JG Mileage enabled and
jg-vehiclemileagestarted, it reads JG; otherwise it reads Sky's saved mileage. - Arguments:
plate(string) - vehicle plate text. Required.
- Returns:
number | nil- whole kilometres, including0when Sky has no saved reading;nilfor invalid input or a database read failure. An active JG lookup failure raises an error.
local mileage = exports["sky_mechanicjob"]:GetVehicleMileage("ABC123")
if mileage then
print(("Mileage: %s"):format(mileage))
end