GetVehicleDoorState: Difference between revisions
Jump to navigation
Jump to search
mNo edit summary |
(Made the argument and return sections clearer.) |
||
Line 1: | Line 1: | ||
__NOTOC__ | __NOTOC__ | ||
{{Server client function}} | {{Server client function}} | ||
This function returns the current state of | This function returns the current state of the specifed door on the vehicle. | ||
==Syntax== | ==Syntax== | ||
Line 7: | Line 7: | ||
==Required Arguments== | ==Required Arguments== | ||
*'''theVehicle:''' | *'''theVehicle:''' The vehicle you want to get the door status of. | ||
*'''door:''' A whole number | *'''door:''' A whole number representing which door to get the status of. Valid values are: | ||
** '''0:''' Hood | |||
** '''1:''' Trunk | |||
** '''2:''' Front left | |||
** '''3:''' Front right | |||
** '''4:''' Rear left | |||
** '''5:''' Rear right | |||
==Returns== | ==Returns== | ||
If successful, one of the following integers will be returned: | |||
* '''0:''' Shut (Undamaged) | * '''0:''' Shut (Undamaged) (also returned if no such door exists on the vehicle) | ||
* '''1:''' Open (Undamaged) | * '''1:''' Open (Undamaged) | ||
* '''2:''' Shut (Damaged) | * '''2:''' Shut (Damaged) | ||
* '''3:''' Open (Damaged) | * '''3:''' Open (Damaged) | ||
* '''4:''' Fallen off | * '''4:''' Fallen off | ||
==Example== | ==Example== |
Revision as of 03:40, 24 December 2011
This function returns the current state of the specifed door on the vehicle.
Syntax
int getVehicleDoorState ( vehicle theVehicle, int door )
Required Arguments
- theVehicle: The vehicle you want to get the door status of.
- door: A whole number representing which door to get the status of. Valid values are:
- 0: Hood
- 1: Trunk
- 2: Front left
- 3: Front right
- 4: Rear left
- 5: Rear right
Returns
If successful, one of the following integers will be returned:
- 0: Shut (Undamaged) (also returned if no such door exists on the vehicle)
- 1: Open (Undamaged)
- 2: Shut (Damaged)
- 3: Open (Damaged)
- 4: Fallen off
Example
local newcar = createVehicle ( 520, 1024, 1024, 1024 ) local state = getVehicleDoorState ( newcar, 2 ) outputChatBox ( "The 3rd door state on this car: " .. state )
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