SetVehicleDoorState: Difference between revisions
Jump to navigation
Jump to search
(Clarified some things.) |
|||
Line 1: | Line 1: | ||
__NOTOC__ | __NOTOC__ | ||
{{Server client function}} | {{Server client function}} | ||
This function sets the | This function sets the state of the specified door on a vehicle. | ||
==Syntax== | ==Syntax== | ||
Line 10: | Line 10: | ||
==Required Arguments== | ==Required Arguments== | ||
*'''theVehicle:''' The [[vehicle]] that you wish to change the door state of. | *'''theVehicle:''' The [[vehicle]] that you wish to change the door state of. | ||
*'''door:''' | *'''door:''' An integer representing which door to set the state of. Valid values are: | ||
*'''state:''' An integer | **'''0:''' Hood | ||
**'''0:''' intact | **'''1:''' Trunk | ||
**'''1:''' | **'''2:''' Front left | ||
**'''2:''' | **'''3:''' Front right | ||
**'''3:''' | **'''4:''' Rear left | ||
**'''4:''' | **'''5:''' Rear right | ||
*'''state:''' An integer representing the state to set the door to. Valid values are: | |||
**'''0:''' Shut, intact | |||
**'''1:''' Ajar, intact | |||
**'''2:''' Shut, damaged | |||
**'''3:''' Ajar, damaged | |||
**'''4:''' Missing | |||
==Returns== | ==Returns== | ||
Returns ''true'' if the door state was successfully set, ''false'' | Returns ''true'' if the door state was successfully set, ''false'' otherwise. | ||
==Example== | ==Example== |
Revision as of 05:25, 24 December 2011
This function sets the state of the specified door on a vehicle.
Syntax
bool setVehicleDoorState ( vehicle theVehicle, int door, int state )
Required Arguments
- theVehicle: The vehicle that you wish to change the door state of.
- door: An integer representing which door to set the state of. Valid values are:
- 0: Hood
- 1: Trunk
- 2: Front left
- 3: Front right
- 4: Rear left
- 5: Rear right
- state: An integer representing the state to set the door to. Valid values are:
- 0: Shut, intact
- 1: Ajar, intact
- 2: Shut, damaged
- 3: Ajar, damaged
- 4: Missing
Returns
Returns true if the door state was successfully set, false otherwise.
Example
-- create a new vehicle local newcar = createVehicle ( 520, 1024, 1024, 1024 ) -- break its front left door off state = setVehicleDoorState ( newcar, 2, 4 )
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