- Documentation
- Server functions
- setVehicleNitroActivated
Function
setVehicleNitroActivated
Stores nitro being switched on or off. Switching on uses one charge from setVehicleNitroCount (with -1 charges never run out); without charges the function returns false.
Syntax
bool setVehicleNitroActivated(vehicle vehicle, bool active)Arguments
vehiclevehicle- The vehicle.
activebooltrue= on,false= off.
Returns
true on success, false when there are no charges.
Example
local vehicle = createVehicle(411, 2000, -1690, 13.5)
setVehicleNitroCount(vehicle, 3)
setVehicleNitroActivated(vehicle, true)
Notes
State for scripts. In the game nitro works after fitting a nitro part (addVehicleUpgrade, e.g. 1010) and the driver fires it themselves; the nitro functions in this group (setVehicleNitroCount, setVehicleNitroLevel, setVehicleNitroActivated) store state on the server, but the game does not apply it yet.
See also
isVehicleNitroActivatedReturns whether nitro was switched on withsetVehicleNitroActivated.setVehicleNitroCountStores the vehicle's number of nitro charges, used up bysetVehicleNitroActivated.addVehicleUpgradeFits a tuning part to a vehicle (spoiler, wheels, exhaust, nitro, hydraulics, bumpers…), visible and working for every player. The part must fit the model (getVehicleCompatibleUpgradeslists them). If the same slot already had a part, it is replaced; fitting the same part again changes nothing. New parts added withengineRequestModelwork too.