Native referenceFiveM

ADD_DOOR_TO_SYSTEM

0x6F8838D03D1DC226 OBJECT
FUNCTION SIGNATURE
void ADD_DOOR_TO_SYSTEM(Hash doorHash, Hash modelHash, float x, float y, float z, BOOL p5, BOOL scriptDoor, BOOL isLocal);
Property Value
Native Name ADD_DOOR_TO_SYSTEM
Hash 0x6F8838D03D1DC226
Return Type void
Parameters doorHash (Hash), modelHash (Hash), x (float), y (float), z (float), p5 (BOOL), scriptDoor (BOOL), isLocal (BOOL)

Description: p5 only set to true in single player native scripts. 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.

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.

A simple "localized" door-system (with hundreds/thousands of doors) can be created by setting p5, p6, and p7 to false and using EventHandlers to synchronize the states to: DOOR_SYSTEM_SET_DOOR_STATE, DOOR_SYSTEM_SET_OPEN_RATIO, DOOR_SYSTEM_SET_HOLD_OPEN, etc.

Parameters

  • doorHash (Hash) — A (unique) door system identifier
  • modelHash (Hash) — Entity model hash
  • x (float) — The X coordinate of the door object
  • y (float) — The Y coordinate of the door object
  • z (float) — The Z coordinate of the door object
  • p5 (BOOL)
  • scriptDoor (BOOL) — false; relies upon getNetworkGameScriptHandler.
  • isLocal (BOOL) — On true disables the creation CRequestDoorEvent's in DOOR_SYSTEM_SET_DOOR_STATE.
Back to OBJECT