SetVehicleDoorState: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 8: Line 8:
==Required Arguments==
==Required Arguments==
*'''theVehicle:''' A handle to the [[vehicle]] that you wish to change the door state of.
*'''theVehicle:''' A handle to the [[vehicle]] that you wish to change the door state of.
*'''Door:''' A whole number between 0 and 5.
*'''door:''' A whole number between 0 and 5.
*'''State:''' A whole number determining the new state of the door. (0: intact, 1: swinging-free 2: bashed, 3: bashed+swinging-free, 4: missing )
*'''state:''' A whole number 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 it was succesful, ''false otherwise.
Returns ''true'' if it was succesful, ''false'' otherwise.


==Example==
==Example==
<syntaxhighlight lang="lua">local newcar = createVehicle ( 520, 1024, 1024, 1024 )
<syntaxhighlight lang="lua">
state = setVehicleDoorState ( newcar, 2, 4 ) -- Breaks the front-left door off of a vehicle.
local newcar = createVehicle ( 520, 1024, 1024, 1024 )
state = setVehicleDoorState ( newcar, 2, 4 )           -- Breaks the front-left door off of a vehicle.
</syntaxhighlight>
</syntaxhighlight>


==See Also==
==See Also==
{{Vehicle functions}}
{{Vehicle functions}}

Revision as of 20:20, 15 August 2007

This function sets the state of a specified door on the vehicle.

Syntax

setVehicleDoorState ( vehicle theVehice, int door, int state )

Required Arguments

  • theVehicle: A handle to the vehicle that you wish to change the door state of.
  • door: A whole number between 0 and 5.
  • state: A whole number 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 it was succesful, false otherwise.

Example

local newcar = createVehicle ( 520, 1024, 1024, 1024 )
state = setVehicleDoorState ( newcar, 2, 4 )            -- Breaks the front-left door off of a vehicle.

See Also