SetVehicleDoorState: Difference between revisions
Jump to navigation
Jump to search
mNo edit summary |
(Added sections, minor changes) |
||
Line 1: | Line 1: | ||
__NOTOC__ | __NOTOC__ | ||
{{Server client function}} | {{Server client function}} | ||
This function sets the state of a specified door on | This function sets the damage state of a specified door on a vehicle. | ||
==Syntax== | ==Syntax== | ||
<syntaxhighlight lang="lua">setVehicleDoorState ( vehicle | <section name="Server and Client" class="both" show="true"> | ||
<syntaxhighlight lang="lua"> | |||
setVehicleDoorState ( vehicle theVehicle, int door, int state ) | |||
</syntaxhighlight> | |||
==Required Arguments== | ==Required Arguments== | ||
*'''theVehicle:''' | *'''theVehicle:''' The [[vehicle]] that you wish to change the door state of. | ||
*'''door:''' | *'''door:''' An integer between 0 and 5 specifying the door you want to change state of. | ||
*'''state:''' A | *'''state:''' A integer determining the new state of the door: | ||
**'''0:''' intact | |||
**'''1:''' swinging free | |||
**'''2:''' bashed | |||
**'''3:''' bashed and swinging free | |||
**'''4:''' missing | |||
==Returns== | ==Returns== | ||
Returns ''true'' if | Returns ''true'' if the door state was successfully set, ''false'' if invalid arguments, invalid door IDs or invalid state IDs are passed. | ||
</section> | |||
==Example== | ==Example== | ||
<section name="Server and Client" class="both" show="true"> | |||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
-- create a new vehicle | |||
local newcar = createVehicle ( 520, 1024, 1024, 1024 ) | local newcar = createVehicle ( 520, 1024, 1024, 1024 ) | ||
state = setVehicleDoorState ( newcar, 2, 4 ) | -- break its front left door off | ||
state = setVehicleDoorState ( newcar, 2, 4 ) | |||
</syntaxhighlight> | </syntaxhighlight> | ||
</section> | |||
==See Also== | ==See Also== | ||
{{Vehicle functions}} | {{Vehicle functions}} |
Revision as of 20:30, 26 August 2007
This function sets the damage state of a specified door on a vehicle.
Syntax
Click to collapse [-]
Server and ClientsetVehicleDoorState ( vehicle theVehicle, int door, int state )
Required Arguments
- theVehicle: The vehicle that you wish to change the door state of.
- door: An integer between 0 and 5 specifying the door you want to change state of.
- state: A integer determining the new state of the door:
- 0: intact
- 1: swinging free
- 2: bashed
- 3: bashed and swinging free
- 4: missing
Returns
Returns true if the door state was successfully set, false if invalid arguments, invalid door IDs or invalid state IDs are passed.
Example
Click to collapse [-]
Server and Client-- 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