Skip to content

Integrations & compatibility ​

np_doors depends on oxmysql, np_prophandler and np_minigames. The framework, the inventory and the dispatch are bridges; every other np_* sibling has one adapter file under integrations/, detected with GetResourceState, with a fallback when it is missing. A missing resource or export degrades one feature instead of breaking a handler.

At start one line per sibling is printed: active, fallback (...) or missing export <name>. Siblings may start or stop later: the status is checked and printed again. Config.Integrations.<name> = false forces the fallback.

Framework, inventory, dispatch ​

Bridge Options (auto-detection order) Files
Framework es_extended (first target), qbx_core, qb-core, standalone bridge/framework/{client,server}/0_common 1_esx 2_qbx 3_qb 9_standalone
Inventory np_inventory (first target), ox_inventory, qb-inventory (ps / lj), none bridge/inventory/server/0_common 1_np 2_ox 3_qb 9_none
Dispatch np_mdt (10), ps-dispatch (30), cd_dispatch (40), qs-dispatch (50), builtin toast and blip (99) bridge/dispatch/server/*, integrations/np_mdt.lua

Standalone has no jobs: job rules never match there, everything else works. The inventory needs unique items with metadata and a use callback; with none there are no item-based lock types (Items).

Vendored byte-identically, never a dependency: bridge/np_admin.lua (np_admin's lib/np_admin.lua), bridge/np_addon.lua (np_admin's lib/np_addon.lua) and bridge/np_colshape.lua (np_colshape's lib/colshape.lua). The test suite compares them with the canonical copies.

np_prophandler: the engine ​

Every door is exports.np_prophandler:registerDoor({ id = 'npd_<id>', doors = { { model, coords }, ... }, locked }): up to 8 parts and no interact, because np_doors owns the interaction. The state only changes through setDoorLocked. np_doors listens to np_prophandler:doorChanged (it adopts changes of its doors made by others) and np_prophandler:ready (it registers every door again after a restart). np_prophandler does the door system natives, streaming and sync. See np_prophandler doors.

The optional wall devices use more of it, all only while Config.Devices.enabled:

  • Props: registerProps at start and on np_prophandler:ready, registerProp / removeProp when a door's device changes (id np_doors:device:<door id>, frozen, no interact). np_prophandler streams, loads and cleans up the models; models that are not in the game are skipped. The client checks getPropEntity before it draws LEDs or opens the 3D keypad.
  • Placement: /doordevice runs startPlacement (surfaces = { 'wall' }, align = 'auto', an area around the door). See np_prophandler placement.
  • Attachments: the card tap holds np_door_keycard with a synced attach on the right hand and detaches it afterwards. If you restrict client attachments with server.attachments.clientModels, add np_door_keycard.

np_minigames: every breach ​

Only np_doors' breach module calls it: Play(src, game, opts) (server-validated) or Chain for multi-step profiles. lockpick → lockpick, ram → ram (skillcheck while GetGames() has no ram; doorHp per difficulty), thermite → thermite, hack → hexhack or wires, bruteforce → crack, drill → drill. Tools go through opts.item. See Breach & alarms and np_minigames' breach games.

np_* siblings ​

All optional and auto-detected.

Sibling With it Without it
np_admin Permission nodes np_doors.manage, .create, .override, .lockdown, .logs; the settings page; the audit log (category doors, spam flags); the Door manager staff action; the central theme Config.Admins and framework admin groups; no audit log
np_hud Toasts with the auto-lock timer bar, progress bars np_doors' own NUI toast and a simple progress
np_menu Door options in target mode (Config.Interaction.mode = 'target') ox_target, then qb-target, then the prompts
np_phone The Keys app, app RPCs, banners, keys:changed / alerts:changed pushes (Phone app) Toasts; digital keys still work at the door
np_inventory Items registered at runtime, key and keycard metadata, the ram and repair kit uses The ox / qb bridge, or no items
np_faction Job rules over all of a player's jobs (HasJob with grade and duty), police on duty (GetOnDuty) The framework job
np_gangs Gang rules (GetGang; ranks member, trusted, og) qb / qbx PlayerData.gang
np_character Character rules and names Framework identifier and names
np_housing Registers the property access source, listens to np_doors:ring (door cam), uses TimedUnlock to let visitors in Property rules never match
np_shops Public rules that follow a shop's opening hours (IsShopOpen) The rule's time window only
np_passwords Keypads managed by np_passwords (door.pin = { provider = 'np_passwords', lock }: Prompt and ConsumeUnlock). Such doors always keep the NUI keypad, never the 3D keypad Those PIN steps fail
np_surveillance Source np_doors: alarms, breaches and wrong-code bursts become live points (door_alarm, door_alert) on the ops map through pingSource. Intel on a case is filed only when the payload carries a caseId (np_surveillance files intel against an existing case only) Nothing filed
np_cctv An event (kind custom, label "Door alarm" or "Face denied") with a clip from the cameras within 25 m (logEvent) Nothing recorded
np_mdt First dispatch provider (ReportCall, kind alarm) ps / cd / qs-dispatch, else the built-in toast and blip
np_cellnet Jammers block remote toggles from the phone (isJammed) Never jammed
np_clothing isMasked for the face reader; Remove mask through its client export removeMask once it offers one Ped drawables only; a hint
np_colshape Enter and exit of the label range around the doors of the player's grid block. Needed on FiveM Legacy only, GTAV Enhanced has the natives built in A distance loop at 4 Hz
np_prison Routine cell doors at lockdown through np_doors (below) Nothing to do
np_banking Its vault, teller and gate models are in Config.Ignore.models: never registered, refused by the creator Nothing to do

np_prison ​

np_prison closes its cell doors at lockdown through a door system (Config.Routine.doors). With np_doors running, system = 'auto' picks np_doors first (np_doors, then ox_doorlock, then qb-doorlock, then np_prophandler), or set system = 'np_doors':

  • A cell door with npdoors = '<np_doors id>' is locked and unlocked with setLocked.
  • A cell door with only model and coordinates is created in np_doors once as np_prison_cell_<facility>_<i> (building np_prison:<facility>, group cells, type cell, job access for np_prison's guard jobs, no lock chain, no crime methods). An existing door with that id is reused.
  • np_prison's guard key item (prison_guardkey) can be added to np_doors doors as an item access rule or a key lock type, so a copied guard key opens them too.

np_prison supports np_doors from its current main on. Older np_prison builds still reach np_doors through the ox_doorlock shims below: Config.Routine.doors.system = 'ox' with door.ox = '<np_doors id>'. See np_prison integrations.

Addons (np_addon) ​

np_doors is an np_addon host (API level 1). Door-type, access-source and breach-method addons declare np_addon 'np_doors' in their fxmanifest and register inside npAddon.attach('np_doors', fn, { api = 1 }). Their registrations are removed when they stop. See Exports and Addons.

ox_doorlock and qb-doorlock compatibility ​

np_doors answers the calls of the two most common door systems, so scripts written for them work unchanged:

  • ox_doorlock exports: exports.np_doors:getDoor(id) and getDoorFromName(name) return the door with the ox_doorlock fields name and state (1 locked, 0 open); setDoorState(id, state) locks with 1 / true and unlocks with 0 / false. With Config.Compat.oxExports and ox_doorlock not running, exports.ox_doorlock:<same> is answered by np_doors too. A name can be an np_doors id, an imported ox_* / qb_* name or a label.
  • qb-doorlock event: with Config.Compat.qbEvents and qb-doorlock not running, server-side TriggerEvent('qb-doorlock:server:updateState', doorId, locked, ...) drives np_doors doors. Imported qb doors answer to their qb name.

To move the doors themselves over, use the importers.