SetVehicleNitroLevel: Difference between revisions
Jump to navigation
Jump to search
m (→Example) |
Fernando187 (talk | contribs) (Remove obsolete Requirements section) |
||
(2 intermediate revisions by 2 users not shown) | |||
Line 4: | Line 4: | ||
This function sets the nitro level of the [[vehicle]]. | This function sets the nitro level of the [[vehicle]]. | ||
}} | }} | ||
{{Warning|Only works if the vehicle is | {{Warning|Only works if the vehicle is streamed in.}} | ||
==Syntax== | ==Syntax== | ||
<syntaxhighlight lang="lua">bool setVehicleNitroLevel ( vehicle theVehicle, float level )</syntaxhighlight> | <syntaxhighlight lang="lua">bool setVehicleNitroLevel ( vehicle theVehicle, float level )</syntaxhighlight> | ||
Line 21: | Line 21: | ||
function changeNitroLevel(pPlayer) | function changeNitroLevel(pPlayer) | ||
if pPlayer == localPlayer then | if pPlayer == localPlayer then | ||
if getVehicleUpgradeOnSlot(source, 8) | if not getVehicleUpgradeOnSlot(source, 8) then -- Check if the vehicle has nitro in it or not | ||
addVehicleUpgrade(source, 1010) -- Install nitrous | addVehicleUpgrade(source, 1010) -- Install nitrous | ||
end | end | ||
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 sets the nitro level of the vehicle.
Syntax
bool setVehicleNitroLevel ( vehicle theVehicle, float level )
Required Arguments
- theVehicle The vehicle, which you want to set.
- level Nitro level you want to set (ranges from 0.0001 to 1.0).
Returns
Returns true if the nitro level was set successfully to the vehicle, false otherwise.
Example
Click to collapse [-]
ClientThis function installs nitrous to the vehicle and sets the level of it to 0.1 when a player enters the vehicle.
function changeNitroLevel(pPlayer) if pPlayer == localPlayer then if not getVehicleUpgradeOnSlot(source, 8) then -- Check if the vehicle has nitro in it or not addVehicleUpgrade(source, 1010) -- Install nitrous end setVehicleNitroLevel(source, 0.1) -- Set a nitro level of 0.1 to the vehicle end end addEventHandler("onClientVehicleEnter", root, changeNitroLevel)
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