SetVehicleNitroActivated: Difference between revisions
Jump to navigation
Jump to search
(Improved a little the explanation of what does this function do) |
Fernando187 (talk | contribs) (Remove obsolete Requirements section) |
||
(One intermediate revision by one other user not shown) | |||
Line 4: | Line 4: | ||
This function activates or deactivates the nitro on the specified [[vehicle]], like if a player pressed the button for activating nitro. | This function activates or deactivates the nitro on the specified [[vehicle]], like if a player pressed the button for activating nitro. | ||
}} | }} | ||
{{Warning|Only works if the vehicle is | {{Warning|Only works if the vehicle is streamed in.}} | ||
==Syntax== | ==Syntax== | ||
<syntaxhighlight lang="lua">bool setVehicleNitroActivated ( vehicle theVehicle, bool state )</syntaxhighlight> | <syntaxhighlight lang="lua">bool setVehicleNitroActivated ( vehicle theVehicle, bool state )</syntaxhighlight> | ||
Line 30: | Line 30: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
</section> | </section> | ||
==See Also== | ==See Also== | ||
{{Client_vehicle_functions}} | {{Client_vehicle_functions}} |
Latest revision as of 17:10, 7 November 2024
This function activates or deactivates the nitro on the specified vehicle, like if a player pressed the button for activating nitro.
Syntax
bool setVehicleNitroActivated ( vehicle theVehicle, bool state )
Required Arguments
- theVehicle The vehicle to activate or deactivate the nitro on.
- state true if you want to activate the nitro, false if you want to disable it.
Returns
Returns true if the nitro activation state was modified successfully, false otherwise.
Example
Click to collapse [-]
ClientThis example adds and activates nitro in the vehicle the player enters.
function activateNitro(pPlayer) if pPlayer == localPlayer then if not getVehicleUpgradeOnSlot(source, 8) then -- Check if the vehicle has nitro installed or not addVehicleUpgrade(source, 1010) -- Install the nitrous end setVehicleNitroActivated(source, true) -- Activate the nitro end end addEventHandler("onClientVehicleEnter", root, activateNitro) -- When the player enters a vehicle, it executes the function
See Also
- areVehicleLightsOn
- getHeliBladeCollisionsEnabled
- getHelicopterRotorSpeed
- getVehicleAdjustableProperty
- getVehicleComponentPosition
- getVehicleComponentRotation
- getVehicleComponents
- getVehicleComponentScale
- getVehicleComponentVisible
- getVehicleCurrentGear
- getVehicleDummyPosition
- getVehicleGravity
- getVehicleLandingGearDown
- getVehicleModelDummyDefaultPosition
- getVehicleModelDummyPosition
- getVehicleModelExhaustFumesPosition
- getVehicleModelWheelSize
- getVehicleNitroCount
- getVehicleNitroLevel
- getVehicleWheelFrictionState
- getVehicleWheelScale
- isTrainChainEngine
- isVehicleNitroActivated
- isVehicleNitroRecharging
- isVehicleOnGround
- isVehicleWheelOnGround
- isVehicleWindowOpen
- resetVehicleComponentPosition
- resetVehicleComponentRotation
- resetVehicleComponentScale
- resetVehicleDummyPositions
- setHeliBladeCollisionsEnabled
- setHelicopterRotorSpeed
- setVehicleAdjustableProperty
- setVehicleComponentPosition
- setVehicleComponentRotation
- setVehicleComponentScale
- setVehicleComponentVisible
- setVehicleDummyPosition
- setVehicleGravity
- setVehicleLandingGearDown
- setVehicleModelDummyPosition
- setVehicleModelExhaustFumesPosition
- setVehicleModelWheelSize
- setVehicleNitroActivated
- setVehicleNitroCount
- setVehicleNitroLevel
- setVehicleWheelScale
- setVehicleWheelStates
- setVehicleWindowOpen
- Shared
- addVehicleUpgrade
- attachTrailerToVehicle
- blowVehicle
- createVehicle
- detachTrailerFromVehicle
- fixVehicle
- getOriginalHandling
- getTrainDirection
- getTrainPosition
- getTrainSpeed
- getTrainTrack
- getVehicleColor
- getVehicleCompatibleUpgrades
- getVehicleController
- getVehicleDoorOpenRatio
- getVehicleDoorState
- getVehicleEngineState
- getVehicleHandling
- getVehicleHeadLightColor
- getVehicleLandingGearDown
- getVehicleLightState
- getVehicleMaxPassengers
- getVehicleModelFromName
- getVehicleName
- getVehicleNameFromModel
- getVehicleOccupant
- getVehicleOccupants
- getVehicleOverrideLights
- getVehiclePaintjob
- getVehiclePanelState
- getVehiclePlateText
- getVehicleSirenParams
- getVehicleSirens
- getVehicleSirensOn
- getVehicleTowedByVehicle
- getVehicleTowingVehicle
- getVehicleTurretPosition
- getVehicleType
- getVehicleUpgradeOnSlot
- getVehicleUpgradeSlotName
- getVehicleUpgrades
- getVehicleVariant
- getVehicleWheelStates
- isTrainDerailable
- isTrainDerailed
- isVehicleBlown
- isVehicleDamageProof
- isVehicleFuelTankExplodable
- isVehicleLocked
- isVehicleOnGround
- isVehicleTaxiLightOn
- removeVehicleUpgrade
- setTrainDerailable
- setTrainDerailed
- setTrainDirection
- setTrainPosition
- setTrainSpeed
- setTrainTrack
- setVehicleColor
- setVehicleDamageProof
- setVehicleDoorOpenRatio
- setVehicleDoorState
- setVehicleDoorsUndamageable
- setVehicleEngineState
- setVehicleFuelTankExplodable
- setVehicleHandling
- setVehicleHeadLightColor
- setVehicleLandingGearDown
- setVehicleLightState
- setVehicleLocked
- setVehicleOverrideLights
- setVehiclePaintjob
- setVehiclePanelState
- setVehiclePlateText
- setVehicleSirens
- setVehicleSirensOn
- setVehicleTaxiLightOn
- setVehicleTurretPosition
- setVehicleVariant
- setVehicleWheelStates