ObjectClient

setStateOfClosestDoorOfType

SET_STATE_OF_CLOSEST_DOOR_OF_TYPE0xF82D8F1926A02C3D

The GTA V native SET_STATE_OF_CLOSEST_DOOR_OF_TYPE of the OBJECT namespace, as LS:MP client scripts call it: the global function setStateOfClosestDoorOfType, in JavaScript and in Lua.

SignatureJavaScript
setStateOfClosestDoorOfType(
  type: Hash,
  x: number,
  y: number,
  z: number,
  locked: boolean,
  heading: number,
  p6: boolean
): void
SignatureLua
setStateOfClosestDoorOfType(
  type: Hash,
  x: number,
  y: number,
  z: number,
  locked: boolean,
  heading: number,
  p6: boolean
)

Usage

JavaScript
setStateOfClosestDoorOfType(type, x, y, z, locked, heading, p6);
Lua
setStateOfClosestDoorOfType(type, x, y, z, locked, heading, p6)

Three consecutive numbers can be given as one vector: { x, y, z } (or [x, y, z]) in JavaScript, a Vector3 in Lua.

JavaScript · with vectors
setStateOfClosestDoorOfType(type, pos, locked, heading, p6);
Lua · with vectors
setStateOfClosestDoorOfType(type, pos, locked, heading, p6)

Parameters

ParameterTypeJavaScriptLua
typeHashnumberinteger
xfloatnumbernumber
yfloatnumbernumber
zfloatnumbernumber
lockedBOOLbooleanboolean
headingfloatnumbernumber
p6BOOLbooleanboolean

Returns

Nothing. In JavaScript the call evaluates to undefined.

Notes

From the community native database. Names are LS:MP’s; samples may be written for C++ or another framework.

Hardcoded to not work in multiplayer.

Used to lock/unlock doors to interior areas of the game.

(Possible) Door Types:

https://pastebin.com/9S2m3qA4

Heading is either 1, 0 or -1 in the scripts. Means default closed(0) or opened either into(1) or out(-1) of the interior.
Locked means that the heading is locked.
p6 is always 0.

225 door types, model names and coords found in stripclub.c4:
https://pastebin.com/gywnbzsH

get door info: https://pastebin.com/i14rbekD

Reference

Namespace
Object OBJECT
In the game
void SET_STATE_OF_CLOSEST_DOOR_OF_TYPE(Hash type, float x, float y, float z, BOOL locked, float heading, BOOL p6)
Hash
0xF82D8F1926A02C3D

Open in the interactive natives reference