GetVehicleDoorState

From Multi Theft Auto: Wiki
Jump to navigation Jump to search

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

Syntax

int getVehicleDoorState ( theVehicle, door )

Required Arguments

  • theVehicle: 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