Installation ​
Requirements ​
- A recent FiveM server artifact (Lua 5.4) with OneSync (the server reads positions, routing buckets and the clothing of the player's own ped)
- oxmysql
- np_prophandler: the door engine. np_doors registers every door with it
(
registerDoor,setDoorLocked); np_prophandler puts the doors into the game's door system, streams and syncs them - np_minigames 1.2.0+: every breach is one of its games. 1.2.0 brings the
ramgame for the police ram; with an older np_minigames the ram falls back toskillcheck - Node 18+ to build the NUI once, if your copy has no
web/distyet
oxmysql, np_prophandler and np_minigames are dependencies in the fxmanifest and must start before np_doors.
Optional, auto-detected at start (each with a fallback, see Integrations):
| Kind | Resources | Without it |
|---|---|---|
| Framework | es_extended (first target), qbx_core, qb-core | Standalone: no jobs, identifiers are the FiveM license |
| Inventory | np_inventory (first target), ox_inventory, qb-inventory (and the ps / lj forks) | none: no keys, keycards, ram or repair kit; access rules, PINs and biometrics still work |
| Target | np_menu, ox_target, qb-target | Only used with Config.Interaction.mode = 'target'; otherwise np_doors' own world prompts |
| Dispatch | np_mdt, ps-dispatch, cd_dispatch, qs-dispatch | A built-in toast and blip for police on duty |
Optional np_* siblings: np_admin, np_hud, np_phone, np_faction, np_gangs, np_character, np_housing, np_shops,
np_passwords, np_surveillance, np_cctv, np_cellnet, np_clothing, np_colshape, np_prison and np_banking. What each one
adds is on Integrations. np_admin, np_addon and np_colshape are vendored as libraries
(bridge/*.lua, byte-identical to their canonical copies) and are never a dependency.
Steps ​
- Put the folder into your resources as
np_doors. Item definitions callnp_doors.useItemand other resources callexports.np_doors, so keep the name. - Start order in
server.cfg. The framework and the inventory are detected once, at start:cfgensure oxmysql ensure es_extended # or qbx_core / qb-core ensure np_inventory # or ox_inventory / qb-inventory ensure np_admin # optional: staff rights, settings, audit log ensure np_prophandler # required: the door engine ensure np_minigames # required: every breach ensure np_phone # optional siblings, any order ensure np_faction ensure np_doors - Database: the tables (prefixed
npd_:npd_doors,npd_access,npd_keys,npd_biometrics,npd_log,npd_meta) are created and migrated at every start.sql/install.sqlhas the same schema if you prefer to import it by hand. - Items (Items): nothing to do on np_inventory; paste the block on ox_inventory and qb-inventory.
- The NUI. A release ships the NUI prebuilt in
web/dist. A fresh clone needs it built once (Node 18+):shWithout the build the labels, readers, manager and creator are blank. Build again after any change undercd web && npm install && npm run buildweb/. The build also producesweb/dist/keypad.html, the screen of the 3D keypad (every*.htmlinweb/is an entry). - Staff: grant
np_doors.manage(andnp_doors.create,np_doors.override,np_doors.lockdown,np_doors.logsas needed) in np_admin's permission matrix, or list identifiers inConfig.Adminswithout np_admin. See Commands & permissions. - Doors: edit the example doors in
shared/config/20_doors.lua, place new ones with/doorcreate, or import your old door system with/doors import ox|qb|nui <resource>(Manager & creator). - Wall devices (optional):
stream/ships the device models and their clips (np_door_keypad,np_door_cardreader,np_door_biometricand the hand propnp_door_keycard, each.ydr/.ytd/.ytyp, plusnp_doors_anim_devices.ycd). FiveM streams the folder by itself; the fxmanifest listsstream/*.ytypinfilesand requests each archetype withdata_file 'DLC_ITYP_REQUEST' 'stream/<model>.ytyp'. Nothing is spawned until you setConfig.Devices.enabled = trueand place devices with/doordevice(World devices & 3D keypad). To ship without the custom props, deletestream/and the fourdata_filelines; np_doors then falls back to vanilla models by itself. - Start the server and read the start-up lines: one per sibling (
active,fallback (...)ormissing export <name>). The status is printed again whenever a sibling starts or stops.
Check it works ​
- The console prints one line per sibling.
- Walk to Mission Row PD. The front doors show a far tile from 25 m, a name chip from 10 m and the full card at the door.
- At the reception gate press
Eas a police officer: it unlocks and locks itself again after 5 s. Without the job the card says No access. - As staff open
/doors, pick a door and press Unlock, then open its Lock & crime tab. - Give yourself a keycard with
/doorcard mrpd 2and swipe it at the cell block door.
Before you open it ​
What the test harness cannot see is the game itself. Check these once on your server:
- The example doors in
20_doors.luaare set for the vanilla Mission Row PD. Move or replace them for your MLOs;/doorcreatereads model, position and heading off the real entity. - Gloves and helmets.
Config.Finger.bareArmsandConfig.Face.helmetshold freemode drawable numbers. Clothing packs shift them: add your own numbers, or gloves and helmets are read wrongly. - Sounds.
Config.Sounds(inclient/modules/effects.lua) maps unlock, lock, deny, knock, ring and alarm to GTA sound names. Listen to them once. - Ignored models.
Config.Ignore.modelskeeps np_banking's vault, teller and gate doors out. Add the models of any other resource that drives its own doors. - Wall devices, if you turn them on: they have not been run on a live server yet. Check that the props spawn and sit flush, the LEDs land on the lenses, the animations reach the device and the 3D keypad's camera and clicks line up (World devices & 3D keypad).
- Balance. Breach cooldowns, ram door integrity (
Config.Ram.doorHp), keypad lockouts and alarm chances are first values.
Troubleshooting ​
| Symptom | Fix |
|---|---|
| np_doors does not start | np_prophandler or np_minigames is not started before it (both are dependencies) |
| Labels, readers or the manager are blank | Build the NUI (web/dist missing), see step 5 |
| Keys, keycards or the ram do nothing on ox / qb | Paste the item block (Items); the ram and repair kit call np_doors.useItem |
| The ram plays the skill ring instead of the ram game | np_minigames is older than 1.2.0 (GetGames() has no ram) |
| A door does not move although the card says open | The model or position does not match the map entity; re-place it with the creator |
| The creator refuses a door | Its model is in Config.Ignore.models, or another resource already registered it with the door system |
| Wall devices do not appear | Config.Devices.enabled is false (the default; changing it needs a restart), the door has no device, or np_prophandler is not started |
| Devices show vanilla models | stream/ is missing or its .ydr files are not there; np_doors falls back to the vanilla models |
| The card tap plays without a card | np_door_keycard is not in np_prophandler's server.attachments.clientModels allowlist |
| The NUI keypad opens instead of the 3D keypad | See when the NUI keypad is used: vanilla device, np_passwords PIN, odd mounting height, in a vehicle, or the feature off |
| Gloves are not detected | Add the arms drawables of your clothing pack to Config.Finger.bareArms (everything not listed counts as gloves) |