Mileage System
getMileage
With following export you can get mileage of an vehicle [vehicle must be networked].
entity
number
exports['p_mechanicjob']:getMileage(entity)entity
number
exports['p_mechanicjob']:getMileage(entity)Example of Usage
local entity = GetVehiclePedIsIn(PlayerPedId(), false)
local mileage = exports['p_mechanicjob']:getMileage(entity)
print(mileage)
-- THIS CODE WILL RETURN MILEAGE OF PLAYER VEHICLElocal playerId = 1 -- replace with existing player id
local playerPed = GetPlayerPed(playerId)
local entity = GetVehiclePedIsIn(playerPed, false)
local mileage = exports['p_mechanicjob']:getMileage(entity)
print(mileage)
-- THIS CODE WILL PRINT MILEAGE OF PLAYER VEHICLEformatMileage
With this export you can format vehicle mileage.
mileage
number
exports['p_mechanicjob']:formatMileage(mileage)mileage
number
exports['p_mechanicjob']:formatMileage(mileage)Example of Usage
local entity = GetVehiclePedIsIn(PlayerPedId(), false)
local mileage = exports['p_mechanicjob']:getMileage(entity)
local formattedMileage = exports['p_mechanicjob']:formatMileage(mileage)
print(formattedMileage)
-- THIS CODE WILL PRINT FORMATTED MILEAGE OF PLAYER VEHICLElocal playerId = 1 -- replace with existing player id
local playerPed = GetPlayerPed(playerId)
local entity = GetVehiclePedIsIn(playerPed, false)
local mileage = exports['p_mechanicjob']:getMileage(entity)
local formattedMileage = exports['p_mechanicjob']:formatMileage(mileage)
print(formattedMileage)
-- THIS CODE WILL PRINT FORMATTED MILEAGE OF PLAYER VEHICLELast updated