chaser_getpp

chaser_getpp( [string] name, [bool] istunecalc, [float] weight, [string] enginename, [table] turbodata, [bool] printindividualstats, [bool] hastransmissionupgrade, [string] currenttyre,)

Returns the pp rating alongside the power. top speed, acceleration and handling ratings.

if “istunecalc” is true, you'll need to input the turbodata in this specific manner:

(P.S: the table name can be whatever, just the keys that need to be exactly this name.)

        local sendturbodata = {
            compressorsize = --INT value, 
            boosttype = --INT value,
            peakturbodecayboost = --INT value,
            turbodecaypoint = --Float value,
            maxtrboostpmax = --Float value,
            maxtrboostpmin = --Float value,
            maxtrboostpminprct = --INT value,
            maxtrboostpmaxprct = --INT value,
            booststartpoint = --Float value,
        }

Now, below are examples for commands to check the pp, both account the car tune, and the car stock.

local chaser = exports['legacydmc_chaser']

RegisterCommand("getpptuned", function()
    if chaser:chaser_getloadstatus() then
        local ped = PlayerPedId()
        local vehicle = GetVehiclePedIsIn(ped, false)
        local weight = chaser:chaser_getweight()
        local engine = chaser:chaser_getengine()
        local turbodata = chaser:chaser_getturbo()
        local hastransmissionupgrade = GetVehicleMod(vehicle,13) >= 0
        local tiredata = chaser:chaser_gettyre()
        local currenttire = tiredata.tyre
        local sendturbodata = {
            compressorsize = turbodata.size, --INT value 
            boosttype = turbodata.typeid, --INT value
            peakturbodecayboost = turbodata.ptdboost, --INT value
            turbodecaypoint = turbodata.tdp, --Float value
            maxtrboostpmax = turbodata.mtbpmax, --Float value
            maxtrboostpmin = turbodata.mtbpmin, --Float value
            maxtrboostpminprct = turbodata.mtbpminprct, --INT value
            maxtrboostpmaxprct = turbodata.mtbpmaxprct,  --INT value
            booststartpoint = turbodata.bsp --Float value
        }
        local table = chaser:chaser_getpp(chaser:chaser_getvehname(),true,weight,engine,sendturbodata,true,hastransmissionupgrade,currenttire)
        print("Vehicle Ratings: "..math.floor(table.pp))
        print("Power: "..math.floor(table.power).." | Acc: "..math.floor(table.acc))
        print("Top Speed: "..math.floor(table.speed).." | Handling: "..math.floor(table.grip))
    end
end, false)

RegisterCommand("getpp", function()
    if chaser:chaser_getloadstatus() then
        local table = chaser:chaser_getpp(chaser:chaser_getvehname(),false,0.0,"stock",nil,true,false,nil)
        print("Vehicle Ratings: "..math.floor(table.pp))
        print("Power: "..math.floor(table.power).." | Acc: "..math.floor(table.acc))
        print("Top Speed: "..math.floor(table.speed).." | Handling: "..math.floor(table.grip))
    end
end, false)

Last updated