SetVehicleDoorState

From GT-MP
Jump to: navigation, search
SetVehicleDoorState
Shared Function
Utilities-terminal.png Server-Side System-users.png Client-Side
Csharp.png C# Javascript.png JavaScript

Will set a specific vehicle door to be open or closed. If the third parameter is set to be true, the door will be set to open.

Syntax

In C#
Server-Side Function

API.setVehicleDoorState(NetHandle vehicle, int door, bool open);
  • vehicle: parameter input should be in NetHandle type.
  • door: parameter input should be in int type.
  • open: parameter input should be in bool type.

In Javascript
Client-Side Function

API.setVehicleDoorState(LocalHandle vehicle, int door, bool open);
  • vehicle: parameter input should be in LocalHandle type.
  • door: parameter input should be in int type.
  • open: parameter input should be in bool type.

Usage example(s)

In C#
Server-Side Function

[Command("example")]
public void ExampleCommand(Client sender)
{
  var vehicle = API.createVehicle(VehicleHash.Voltic, sender.position, new Vector3(), 0, 0);
  API.setVehicleDoorState(vehicle.handle, 0, true);
}

Changelog

Version Description
1.0 Release.

References