addDoorToSystem
ADD_DOOR_TO_SYSTEM0x6F8838D03D1DC226The GTA V native ADD_DOOR_TO_SYSTEM of the OBJECT namespace, as LS:MP client scripts call it: the global function addDoorToSystem, in JavaScript and in Lua.
addDoorToSystem(
doorHash: Hash,
modelHash: Hash,
x: number,
y: number,
z: number,
p5: boolean,
scriptDoor: boolean,
isLocal: boolean,
p8: any
): voidaddDoorToSystem(
doorHash: Hash,
modelHash: Hash,
x: number,
y: number,
z: number,
p5: boolean,
scriptDoor: boolean,
isLocal: boolean,
p8: any
)Usage
addDoorToSystem(doorHash, modelHash, x, y, z, p5, scriptDoor, isLocal, p8);addDoorToSystem(doorHash, modelHash, x, y, z, p5, scriptDoor, isLocal, p8)Three consecutive numbers can be given as one vector: { x, y, z } (or [x, y, z]) in JavaScript, a Vector3 in Lua.
addDoorToSystem(doorHash, modelHash, pos, p5, scriptDoor, isLocal, p8);addDoorToSystem(doorHash, modelHash, pos, p5, scriptDoor, isLocal, p8)Parameters
| Parameter | Type | JavaScript | Lua |
|---|---|---|---|
doorHash | Hash | number | integer |
modelHash | Hash | number | integer |
x | float | number | number |
y | float | number | number |
z | float | number | number |
p5 | BOOL | boolean | boolean |
scriptDoor | BOOL | boolean | boolean |
isLocal | BOOL | boolean | boolean |
p8 | Any | any | any |
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.
p5 only set to true in single player native scripts.
If scriptDoor is true, register the door on the script handler host (note: there's a hardcap on the number of script IDs that can be added to the system at a given time). If scriptDoor and isLocal are both false, the door is considered to be in a "Persists w/o netobj" state.
door hashes normally look like PROP_[int]_DOOR_[int] for interior doors and PROP_BUILDING_[int]_DOOR_[int] exterior doors but you can just make up your own hash if you want
All doors need to be registered with addDoorToSystem before they can be manipulated with the door natives and the easiest way to get door models is just find the door in codewalker.
Example: AddDoorToSystem("PROP_43_DOOR_0", "hei_v_ilev_fh_heistdoor2", -1456.818, -520.5037, 69.67043, 0, 0, 0)
Reference
- Namespace
- Object OBJECT
- In the game
void ADD_DOOR_TO_SYSTEM(Hash doorHash, Hash modelHash, float x, float y, float z, BOOL p5, BOOL scriptDoor, BOOL isLocal, Any p8)- Hash
0x6F8838D03D1DC226