Returns a table containing the performance index calculation data.
If you don't have the car tuned, or didn't tuned all the way, you can pass the args as "nil" with exception for the vehicleHash, and it will calculate the P.I with the stock data, alongside the tuning data if there is any. If all is nil, it will calculate the P.I data with stock vehicle performance data.
Preferably, you should input the vehicle hash as "elegy" for example.
However if you input it's hash "196747873" it will also work, but will have the function to take longer to execute.
local piPressed = WarMenu.Button("Performance Index: "..currentPerformanceIndex)
if WarMenu.IsItemHovered() then
WarMenu.ToolTip('Press Enter to calculate the PI for the current vehicle (stock)',nil,true)
end
if piPressed then
local currentCarModel = GetEntityModel(GetVehiclePedIsIn(PlayerPedId(),false))
local performanceData = dynamic:getPerformanceIndex(currentCarModel,nil,nil,nil,nil,nil,nil)
currentPerformanceIndex = performanceData.PI -- since we are calculating the stock PI, we can pass all args as nil.
currentAccHandlingScore = performanceData.accScore
currentBrakingHandlingScore = performanceData.brakingScore
currentTopSpeedHandlingScore = performanceData.estimatedTopSpeedScore
currentPiHandlingScore = performanceData.handlingScore
end
local piPressed = WarMenu.Button("Acceleration Score: "..currentAccHandlingScore/100)
local piPressed = WarMenu.Button("Braking Score: "..currentBrakingHandlingScore/100)
local piPressed = WarMenu.Button("Top Speed Score: "..currentTopSpeedHandlingScore/100)
local piPressed = WarMenu.Button("Handling Score: "..currentPiHandlingScore/100)