setVehicleNitroCount | Multi Theft Auto: Wiki Skip to content

setVehicleNitroCount

Client-side
Server-side
Shared

This page is incomplete! Help wanted!

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


This function sets how many times a player can activate the nitro on a specified vehicle.

Caution

Only works if the vehicle is streamed in.

Syntax

setVehicleNitroCount ( )

Code Examples

client

This function installs nitro in the vehicle a player enters and then makes it usable only twice.

function infiniteNitro(pPlayer)
if pPlayer == localPlayer then
if not getVehicleUpgradeOnSlot(source, 8) then -- Does the vehicle have nitro installed or not
addVehicleUpgrade(source, 1010) -- Install nitrous
end
setVehicleNitroCount(source, 2) -- Make the nitro usable twice
end
end
addEventHandler("onClientVehicleEnter", root, infiniteNitro)

See Also

Vehicle Functions