GetVehicleEngineState: Difference between revisions
Jump to navigation
Jump to search
OpenIDUser32 (talk | contribs) No edit summary |
OpenIDUser32 (talk | contribs) No edit summary |
||
Line 33: | Line 33: | ||
==Changelog== | ==Changelog== | ||
*2008-06-23 - added ( | *2008-06-23 - added ({{i|3544}}) | ||
*2009-07-24 - fixed | *2009-07-24 - fixed {{i|4687}} | ||
*2009-08-22 - fixed | *2009-08-22 - fixed {{i|4851}} | ||
==See Also== | ==See Also== | ||
{{Vehicle functions}} | {{Vehicle functions}} |
Revision as of 12:08, 23 November 2011
This function returns a vehicle's engine state (on or off).
{{{4}}}
Syntax
bool getVehicleEngineState ( vehicle theVehicle )
Required Arguments
- theVehicle: The vehicle you wish to get the engine state of.
Returns
Returns true if the vehicle's engine is started, false otherwise.
Example
Click to collapse [-]
Serverside exampleThis example will switch the vehicle engine state with the command "/switchengine".
function switchEngine ( playerSource ) local theVehicle = getPedOccupiedVehicle ( playerSource ) -- Check if the player is in any vehicle and if he is the driver if theVehicle and getVehicleController ( theVehicle ) == playerSource then local state = getVehicleEngineState ( theVehicle ) setVehicleEngineState ( theVehicle, not state ) end end addCommandHandler ( "switchengine", switchEngine )
Changelog
- 2008-06-23 - added (Template:I)
- 2009-07-24 - fixed Template:I
- 2009-08-22 - fixed Template:I
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