setVehicleNitroLevel | Multi Theft Auto: Wiki Skip to content

setVehicleNitroLevel

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 sets the nitro level of the vehicle.

Caution

Only works if the vehicle is streamed in.

Syntax

bool setVehicleNitroLevel ( vehicle theVehicle, float level )
Required Arguments
  • theVehicle:
  • level:

Returns

  • bool: value

Returns true if the nitro level was set successfully to the vehicle, false otherwise.

Code Examples

shared

This function installs nitrous to the vehicle and sets the level of it to 0.1 when a player enters the vehicle.

function changeNitroLevel(pPlayer)
if pPlayer == localPlayer then
if not getVehicleUpgradeOnSlot(source, 8) then -- Check if the vehicle has nitro in it or not
addVehicleUpgrade(source, 1010) -- Install nitrous
end
setVehicleNitroLevel(source, 0.1) -- Set a nitro level of 0.1 to the vehicle
end
end
addEventHandler("onClientVehicleEnter", root, changeNitroLevel)

See Also

Vehicle Functions