SetVehicleNitroActivated: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
m (fixes) |
||
Line 2: | Line 2: | ||
{{Client function}} | {{Client function}} | ||
{{New feature/item|4.0132|1.3.1|4993| | {{New feature/item|4.0132|1.3.1|4993| | ||
This function | This function activates the nitro on the [[vehicle]]. | ||
}} | }} | ||
{{Warning|Function is not working correctly. -[[User:Ccw|Ccw]]}} | |||
{{Warning|Function not working correctly}} | |||
==Syntax== | ==Syntax== | ||
<syntaxhighlight lang="lua">bool setVehicleNitroActivated ( vehicle theVehicle, bool state )</syntaxhighlight> | <syntaxhighlight lang="lua">bool setVehicleNitroActivated ( vehicle theVehicle, bool state )</syntaxhighlight> | ||
===Required Arguments=== | ===Required Arguments=== | ||
*'''theVehicle''' The [[vehicle]] which you want to check an activation. | *'''theVehicle''' The [[vehicle]], which you want to check an activation. | ||
*'''state''' true if you want to activate the nitro, false if you want to disable it. | *'''state''' ''true'' if you want to activate the nitro, ''false'' if you want to disable it. | ||
===Returns=== | ===Returns=== | ||
Line 18: | Line 17: | ||
==Example== | ==Example== | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
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 | |||
setVehicleNitroActivated(source, true) -- Activate the nitro | |||
else | |||
setVehicleNitroActivated(source, true) | |||
end | end | ||
end | end | ||
)</syntaxhighlight> | end | ||
addEventHandler("onClientVehicleEnter", root, activateNitro) -- When the player enters a vehicle, it executes the function | |||
</syntaxhighlight> | |||
==Requirements== | ==Requirements== |
Revision as of 11:51, 14 March 2013
Syntax
bool setVehicleNitroActivated ( vehicle theVehicle, bool state )
Required Arguments
- theVehicle The vehicle, which you want to check an activation.
- state true if you want to activate the nitro, false if you want to disable it.
Returns
Returns true if the nitro is activated successfully on the vehicle, false otherwise.
Example
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 setVehicleNitroActivated(source, true) -- Activate the nitro else setVehicleNitroActivated(source, true) end end end addEventHandler("onClientVehicleEnter", root, activateNitro) -- When the player enters a vehicle, it executes the function
Requirements
This template will be deleted.
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