GetVehicleNitroLevel: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
Line 20: | Line 20: | ||
function( pPlayer ) | function( pPlayer ) | ||
if pPlayer == localPlayer then | if pPlayer == localPlayer then | ||
if | if getVehicleUpgradeOnSlot( source, 8 ) then -- Nitro installed? | ||
local fNitroLevel = getVehicleNitroLevel( source ) | local fNitroLevel = getVehicleNitroLevel( source ) | ||
outputChatBox( 'Your nitro level for vehicle ' .. getVehicleName( source ) .. ' is ' .. fNitroLevel .. '.' ) | outputChatBox( 'Your nitro level for vehicle ' .. getVehicleName( source ) .. ' is ' .. fNitroLevel .. '.' ) |
Revision as of 17:03, 9 February 2013
Note: This function return false if nitro is not exists. So you need add nitro via function addVehicleUpgrade.
Syntax
float getVehicleNitroLevel ( vehicle theVehicle )
Required Arguments
- theVehicle The vehicle which you want to get a nitro level.
Returns
Returns the nitro level [ range is 0.0001 to 1.0 ] from the vehicle.
Example
addEventHandler( 'onClientVehicleEnter', root, function( pPlayer ) if pPlayer == localPlayer then if getVehicleUpgradeOnSlot( source, 8 ) then -- Nitro installed? local fNitroLevel = getVehicleNitroLevel( source ) outputChatBox( 'Your nitro level for vehicle ' .. getVehicleName( source ) .. ' is ' .. fNitroLevel .. '.' ) 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