getStateOfClosestDoorOfType
GET_STATE_OF_CLOSEST_DOOR_OF_TYPE0xEDC1A5B84AEF33FFThe GTA V native GET_STATE_OF_CLOSEST_DOOR_OF_TYPE of the OBJECT namespace, as LS:MP client scripts call it: the global function getStateOfClosestDoorOfType, in JavaScript and in Lua.
getStateOfClosestDoorOfType(type: Hash, x: number, y: number, z: number): [
locked: boolean,
heading: number
]getStateOfClosestDoorOfType(
type: Hash,
x: number,
y: number,
z: number
): boolean, numberUsage
JavaScript
const [locked, heading] = getStateOfClosestDoorOfType(type, x, y, z);Lua
local locked, heading = getStateOfClosestDoorOfType(type, x, y, z)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
const [locked, heading] = getStateOfClosestDoorOfType(type, pos);Lua · with vectors
local locked, heading = getStateOfClosestDoorOfType(type, pos)Parameters
| Parameter | Type | JavaScript | Lua |
|---|---|---|---|
type | Hash | number | integer |
x | float | number | number |
y | float | number | number |
z | float | number | number |
Returns
2 values, in this order: an array in JavaScript, multiple return values in Lua.
| # | Value | Type | JavaScript | Lua | Description |
|---|---|---|---|---|---|
| 1 | locked | BOOL | boolean | boolean | output |
| 2 | heading | float | number | number | output |
Notes
From the community native database. Names are LS:MP’s; samples may be written for C++ or another framework.
locked is 0 if no door is found
locked is 0 if door is unlocked
locked is 1 if door is found and unlocked.
the locked bool is either 0(unlocked)(false) or 1(locked)(true)
Reference
- Namespace
- Object OBJECT
- In the game
void GET_STATE_OF_CLOSEST_DOOR_OF_TYPE(Hash type, float x, float y, float z, BOOL* locked, float* heading)- Hash
0xEDC1A5B84AEF33FF