SetVehicleNitroActivated: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
Line 21: | Line 21: | ||
function( pPlayer ) | function( pPlayer ) | ||
if pPlayer == localPlayer then | if pPlayer == localPlayer then | ||
if not | if not getVehicleUpgradeOnSlot( source, 8 ) then -- Nitro installed? | ||
addVehicleUpgrade( source, 1010 ) -- Install a nitro. | addVehicleUpgrade( source, 1010 ) -- Install a nitro. | ||
setVehicleNitroActivated( source, true ) -- Activate the nitro. | setVehicleNitroActivated( source, true ) -- Activate the nitro. |
Revision as of 17:02, 9 February 2013
Note: This function return false if nitro is not exists. So you need add nitro via function addVehicleUpgrade.
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
addEventHandler( 'onClientVehicleEnter', root, function( pPlayer ) if pPlayer == localPlayer then if not getVehicleUpgradeOnSlot( source, 8 ) then -- Nitro installed? addVehicleUpgrade( source, 1010 ) -- Install a nitro. setVehicleNitroActivated( source, true ) -- Activate the nitro. end end end )
Requirements
This template will be deleted.
See Also
- 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