getPerformanceIndex
getPerformanceIndex(vehicleHash [string], engineHash [string] ,transmissionData [table] ,tyreCompound [string] powerMultiplier [float] ,weightMultiplier [float] ,brakesMultiplier [float])
return {
PI = math.round(piScoreNormalized),
accScore = math.round(accScore),
handlingScore = math.round(handlingScore),
estimatedTopSpeedScore = math.round(estimatedTopSpeedScore),
praticalTopSpeedScore = math.round(praticalTopSpeedScore),
brakingScore = math.round(brakingDistanceScore),
generalScore = math.round(generalScore),
} 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)