GetVehicleDoorState: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
Line 8: Line 8:
==Required Arguments==
==Required Arguments==
*'''theVehicle:''' A handle to the [[vehicle]] that you wish to know the door state of.
*'''theVehicle:''' A handle to the [[vehicle]] that you wish to know the door state of.
*'''Door:''' A whole number, 0 (hood), 1 (boot), 2 (front left), 3 (front right), 4 (rear left), 5 (rear right)
*'''Door:''' A whole number, 0 (hood), 1 (trunk), 2 (front left), 3 (front right), 4 (rear left), 5 (rear right)


==Returns==
==Returns==

Revision as of 14:03, 15 August 2007

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

Syntax

int getVehicleDoorState ( vehicle theVehicle, int door )

Required Arguments

  • theVehicle: A handle to the vehicle that you wish to know the door state of.
  • Door: A whole number, 0 (hood), 1 (trunk), 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