Dynamic Engine
  • Starting your engine
    • Introducing Dynamic
    • The simulation
    • The network
  • Your first drive
    • Setting the script
    • Creating a Dynamic vehicle profile
    • Editing a Dynamic vehicle profile
    • Migrating from C.H.A.S.E.R
  • Fine Tuning your vehicle
    • Adapting your NUI
    • Editing the engine
    • Creating engine swap profiles
    • Creating a transmission data
    • Creating tyre profiles
    • Creating a new camera
    • Tweaking HUD
    • Setting Up Performance Index
    • Tuning your vehicle
    • Utilizing offsets
  • Exports
    • Learning the exports
    • Brake Exports
      • getBrakeTemp
      • toggleBrakeDebug
      • setBrakeTemp
  • Caller Exports
    • stopDynamic
    • startDynamic
  • Camera Exports
    • getCameraData
    • getCameraAmmount
    • startCamera
    • swapCamera
    • stopCamera
    • setCurrentCameraPitchOffset
    • setCurrentCameraFovOffset
    • setCurrentCameraSpacingOffset
    • setCurrentFpvCameraSpacingOffset
    • toggleBikeYawCorrection
  • Differential Exports
    • getIsVehicleCurrentlyDrifting
    • getIsVehicleCurrentlyDriftingThrottleLess
  • Drivetrain Exports
    • setFrontTorqueDist
  • Ecu Exports
    • setCurrentVehicleTcsLevel
    • toggleTcs
    • toggleEsc
    • getAssists
    • getTelemetryData
    • getGlobalTelemetryData
    • getWheelData
    • getVehicleData
    • getAvailableTyres
    • getTyreData
    • getAvailableEngineSwaps
    • getEngineData
  • Performance Index Exports
    • getPerformanceIndex
    • getPerformanceIndexCalibrationMetrics
  • Transmission Exports
    • getTopSpeedTable
    • getTopSpeedTableFromTransmissionData
    • setTransmissionMode
    • getTransmissionMode
  • Tuning Exports
    • loadTunedSetup
  • Tyre Exports
    • warmTyre
  • From enthusiasts to everyone
    • With Passion.
Powered by GitBook
On this page
  1. Performance Index Exports

getPerformanceIndex

getPerformanceIndex(vehicleHash [string], engineHash [string] ,transmissionData [table] ,tyreCompound [string] powerMultiplier [float] ,weightMultiplier [float] ,brakesMultiplier [float])

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.

Returned Table:

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),
}

Code Example:

        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)
PreviousPerformance Index ExportsNextgetPerformanceIndexCalibrationMetrics