GetVehicleDoorState: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
Line 8: Line 8:
==Required Arguments==
==Required Arguments==
*'''Vehicle:''' A handle to the [[vehicle]] that you wish to know the door state of.
*'''Vehicle:''' A handle to the [[vehicle]] that you wish to know the door state of.
*'''Door:''' A whole number between 0 and 5.
*'''Door:''' A whole number between 0 and 5. ( 0, 1, 2 (front left), 3 (front right), 4 (rear left), 5 (rear right) )
 
==Returns==
Returns 4 [[int]]s indicating the states of the door. These values can be:
* '''0:''' Shut (Undamaged)
* '''1:''' Open (Undamaged)
* '''2:''' Shut (Damaged)
* '''3:''' Open (Damaged)
* '''4:''' Fallen off


==Example==
==Example==

Revision as of 19:15, 10 August 2007

This function returns the current state of a specifed door on the vehicle.

Syntax

int getVehicleDoorState ( vehicle, door )

Required Arguments

  • Vehicle: A handle to the vehicle that you wish to know the door state of.
  • Door: A whole number between 0 and 5. ( 0, 1, 2 (front left), 3 (front right), 4 (rear left), 5 (rear right) )

Returns

Returns 4 ints indicating the states of the door. These values can be:

  • 0: Shut (Undamaged)
  • 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