setVehicleDoorState | Multi Theft Auto: Wiki Skip to content

setVehicleDoorState

Client-side
Server-side
Shared

Pair: getVehicleDoorState

Manual Review Required

Please finish this page using the corresponding Old Wiki article. Go to Contribution guidelines for more information.


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

Note

This parameter doesn't work during the vehicle creation. You need a SetTimer if you need to create the vehicle using this parameter.

OOP Syntax Help! I don't understand this!

Syntax

bool setVehicleDoorState ( vehicle theVehicle, int door, int state )
Required Arguments
  • theVehicle: MISSING_PARAM_DESC
  • door: MISSING_PARAM_DESC
  • state: MISSING_PARAM_DESC

Returns

  • bool: value

Returns true if the door state was successfully set, false otherwise.

Code Examples

shared
-- create a new vehicle
local newcar = createVehicle (420, 2472.5, -1688, 13.3)
-- break its front left door off
setVehicleDoorState (newcar, 2, 4)
-- make its hood disapear
setTimer (setVehicleDoorState, 100, 1, newcar, 0, 4, false)

See Also

Vehicle Functions