SetVehicleNitroCount: Difference between revisions
Jump to navigation
Jump to search
m (typo) |
(Improved the explanation of what does this function do) |
||
Line 2: | Line 2: | ||
{{Client function}} | {{Client function}} | ||
{{New feature/item|3.0131|1.3.1|4993| | {{New feature/item|3.0131|1.3.1|4993| | ||
This function sets the nitro | This function sets how many times a player can activate the nitro on a specified [[vehicle]]. | ||
}} | }} | ||
{{Warning|Only works if the vehicle is streamed in}} | {{Warning|Only works if the vehicle is streamed in.}} | ||
==Syntax== | ==Syntax== | ||
<syntaxhighlight lang="lua">bool setVehicleNitroCount ( vehicle theVehicle, int count )</syntaxhighlight> | <syntaxhighlight lang="lua">bool setVehicleNitroCount ( vehicle theVehicle, int count )</syntaxhighlight> | ||
===Required Arguments=== | ===Required Arguments=== | ||
*'''theVehicle''' | *'''theVehicle''': the [[vehicle]] which you want to modify how many times a player can use its nitro. | ||
*'''count''' | *'''count''': how many times should the player be able to use the nitro of this [[vehicle]] (from 0-100 times; 0 means that it can't be used and 101 means that it can be used infinite times). | ||
===Returns=== | ===Returns=== | ||
Line 17: | Line 17: | ||
==Example== | ==Example== | ||
<section name="Client" class="client" show="true"> | <section name="Client" class="client" show="true"> | ||
This function installs nitro in the vehicle and then | This function installs nitro in the vehicle a player enters and then makes it usable only twice. | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
function infiniteNitro(pPlayer) | function infiniteNitro(pPlayer) | ||
Line 24: | Line 24: | ||
addVehicleUpgrade(source, 1010) -- Install nitrous | addVehicleUpgrade(source, 1010) -- Install nitrous | ||
end | end | ||
setVehicleNitroCount(source, | setVehicleNitroCount(source, 2) -- Make the nitro usable twice | ||
end | end | ||
end | end |
Revision as of 17:29, 4 October 2014
This function sets how many times a player can activate the nitro on a specified vehicle.
Syntax
bool setVehicleNitroCount ( vehicle theVehicle, int count )
Required Arguments
- theVehicle: the vehicle which you want to modify how many times a player can use its nitro.
- count: how many times should the player be able to use the nitro of this vehicle (from 0-100 times; 0 means that it can't be used and 101 means that it can be used infinite times).
Returns
Returns true if the nitro count was set successfully to the vehicle, false otherwise.
Example
Click to collapse [-]
ClientThis 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)
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