JG Docs
Vehicle Mileage

Client Exports

getMileage

Returns the mileage of the vehicle you are currently in.

-- client only
local mileageKm = exports["jg-vehiclemileage"]:getMileage()
ReturnsTypeDescription
mileageKmnumber|falseMileage in kilometres, or false if the entity doesn't exist

getMileageByEntity

Returns the mileage of a specified vehicle entity.

-- client only
-- vehicle: integer - the vehicle entity handle
local mileageKm = exports["jg-vehiclemileage"]:getMileageByEntity(vehicle)
ReturnsTypeDescription
mileageKmnumber|falseMileage in kilometres, or false if the entity doesn't exist

getMileageByPlate

Returns the mileage of a specified vehicle plate.

This export makes a database call, so use sparingly.

-- client only
-- plate: string
local mileageKm = exports["jg-vehiclemileage"]:getMileageByPlate(plate)
ReturnsTypeDescription
mileageKmnumber|falseMileage in kilometres, or false if the plate isn't in the database

getUnit

Returns the unit set in the jg-vehiclemileage config.

-- client only
local unit = exports["jg-vehiclemileage"]:getUnit()
ReturnsTypeDescription
unit"miles"|"kilometers"The configured measurement unit

Last updated 19 July 2026

On this page