getVehicleNitroLevel | Multi Theft Auto: Wiki Skip to content

getVehicleNitroLevel

Client-side
Server-side
Shared

Manual Review Required

Please finish this page using the corresponding Old Wiki article. Go to Contribution guidelines for more information.


This function gets the nitro level of the vehicle.

Caution

Only works if the vehicle is streamed in.

Syntax

float getVehicleNitroLevel ( vehicle theVehicle )
Required Arguments
  • theVehicle:

Returns

  • float: value

Returns a float determining the nitro level (ranges from 0.0001 to 1.0) of the vehicle, false if there is no nitro in the vehicle.

Code Examples

shared

This function displays the nitro level of the vehicle the player is entering.

function displayNitroLevel(pPlayer)
if pPlayer == localPlayer then
if getVehicleUpgradeOnSlot(source, 8) then -- Check if the vehicle has nitro installed
local fNitroLevel = getVehicleNitroLevel(source)
outputChatBox("The nitro level of this " .. getVehicleName(source) .. " is " .. fNitroLevel .. ".", 255, 180, 20, false)
end
end
end
addEventHandler("onClientVehicleEnter", root, displayNitroLevel)

See Also

Vehicle Functions