SetVehicleDoorState
From Multi Theft Auto: Wiki
This function sets the state of the specified door on a vehicle.
Syntax
bool setVehicleDoorState ( vehicle theVehicle, int door, int state )
OOP Syntax Help! I don't understand this!
- Method: vehicle:setDoorState(...)
- Counterpart: getVehicleDoorState
FROM VERSION 1.6.0 r20319 ONWARDS
bool setVehicleDoorState ( vehicle theVehicle, int door, int state [, bool spawnFlyingComponent = true ] )
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 (aka Closed, undamaged)
- 1: Ajar, intact (aka Slightly open, undamaged)
- 2: Shut, damaged (aka Closed, damaged)
- 3: Ajar, damaged (aka Slightly open, damaged)
- 4: Missing
Optional Arguments
NOTE: When using optional arguments, you might need to supply all arguments before the one you wish to use. For more information on optional arguments, see optional arguments.
FROM VERSION 1.6.0 r20319 ONWARDS
- spawnFlyingComponent: A boolean, if set to true, spawns flying doors etc. if you remove a component with state == 4.
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
FROM VERSION 1.5.7 r19626 ONWARDS
- attachTrailerToVehicle
- blowVehicle
- createVehicle
- detachTrailerFromVehicle
- fixVehicle
- getModelHandling
- getOriginalHandling
- getTrainDirection
- getTrainPosition
- getTrainSpeed
FROM VERSION 1.6 r7485 ONWARDS
- getVehicleColor
- getVehicleCompatibleUpgrades
- getVehicleController
- getVehicleDoorOpenRatio
- getVehicleDoorState
- getVehicleEngineState
- getVehicleHandling
- getVehicleHeadLightColor
- getVehicleLandingGearDown
- getVehicleLightState
- getVehicleMaxPassengers
- getVehicleModelFromName
- getVehicleName
- getVehicleNameFromModel
- getVehicleOccupant
- getVehicleOccupants
- getVehicleOverrideLights
- getVehiclePaintjob
- getVehiclePanelState
- getVehiclePlateText
- getVehicleRespawnPosition
- getVehicleRespawnRotation
- getVehicleSirenParams
- getVehicleSirens
- getVehicleSirensOn
- getVehicleTowedByVehicle
- getVehicleTowingVehicle
- getVehicleTurretPosition
- getVehicleType
- getVehicleUpgradeOnSlot
- getVehicleUpgradeSlotName
- getVehicleUpgrades
- getVehicleVariant
- getVehicleWheelStates
- getVehiclesOfType
- isTrainDerailable
- isTrainDerailed
- isVehicleBlown
- isVehicleDamageProof
- isVehicleFuelTankExplodable
- isVehicleLocked
- isVehicleOnGround
- isVehicleTaxiLightOn
- removeVehicleSirens
- removeVehicleUpgrade
- resetVehicleExplosionTime
- resetVehicleIdleTime
- respawnVehicle
- setModelHandling
- setTrainDerailable
- setTrainDerailed
- setTrainDirection
- setTrainPosition
- setTrainSpeed
FROM VERSION 1.6 r7485 ONWARDS
- setVehicleColor
- setVehicleDamageProof
- setVehicleDoorOpenRatio
- setVehicleDoorState
- setVehicleDoorsUndamageable
- setVehicleEngineState
- setVehicleFuelTankExplodable
- setVehicleHandling
- setVehicleHeadLightColor
- setVehicleIdleRespawnDelay
- setVehicleLandingGearDown
- setVehicleLightState
- setVehicleLocked
- setVehicleOverrideLights
- setVehiclePaintjob
- setVehiclePanelState
- setVehiclePlateText
- setVehicleRespawnDelay
- setVehicleRespawnPosition
- setVehicleRespawnRotation
- setVehicleSirens
- setVehicleSirensOn
- setVehicleTaxiLightOn
- setVehicleTurretPosition