All products

np_doors

Every door on the server in one system. A label in the world tells you why you may open a door, and a chain of keys, keycards, keypads, fingerprints and face recognition decides whether you do. The other side picks, rams, burns and hacks its way in through np_minigames, and the alarm reaches dispatch, the cameras and the owner's phone. Optional wall devices show the door state on their LEDs, and on the 3D keypad you type the code on the prop itself, where others can watch. np_prophandler runs the doors in the engine.

v1.0.0ESX · qbx · qb · standaloneRequires oxmysqlRequires np_prophandlerRequires np_minigames
Price TBAStore link follows at release
Installation guideDocumentation
Version
1.0.0
Frameworks
ESX first, qbx, qb, standalone
Dependencies
oxmysql, np_prophandler (the door engine), np_minigames (every breach)
Database
Tables created on start
Inventory
np_inventory first (items registered at runtime), then ox_inventory, qb-inventory or none
Staff
np_admin permission nodes, settings and audit log. No ACE
Optional
np_phone, np_faction, np_housing, np_cctv, np_surveillance, np_mdt, np_hud and more
Languages
English, German
Build
NUI ships prebuilt in releases, Node to build it from source
Doors in the world: the Mission Row PD front doors as a near card, open, with E Lock, G knock and ALT details, and the small lock tiles of the doors further inside
Doors in the world: the Mission Row PD front doors as a near card, locked, with Unlock and the reason LSPD · Sergeant, a cell block door as a name chip further away, the prompt variants on the right (keycard, code, lockpick, no access, scan face, a shared key) and an unlock toast with the auto-lock timer

The world labels, the manager and the creator are in-game captures from a local ESX server. The readers, the manager tabs and the Keys app are rendered from the NUI in the browser at 1920×1080 with mock data over a game scene. Reader shots are cropped to the card, phone shots to the device. The wall devices are Blender renders of the shipped models, the 3D keypad a mockup over a prop render.

What's in it

The server decides every toggle: distance, routing bucket, rate limit, access and the lock chain. The client only draws the labels and the readers.

Doors in the world

  • Labels with three levels of detail: a tile far away, a name chip closer, a card at the door with the reason, such as "Police · grade 2+" or "Key from Mia · 2 h".
  • Knock, ring and details as secondary keys, or target mode with np_menu, ox_target or qb-target.
  • Single, double, sliding, garage, gate and cell doors, up to eight parts each.

Access rules

  • Job (grade, on duty, every job through np_faction), gang, identifier, character, item, property and your own access sources. Deny wins.
  • Public doors in time windows or while an np_shops shop is open. Temporary grants.
  • Rules per door, group or building, a staff override and a building lockdown.

Lock chains

  • Physical keys, keycards with a group, level, uses and expiry, and keypads hashed with a per-door salt, with a lockout and an alarm, or managed by np_passwords.
  • Fingerprints: gloves fail, forged prints count as the person they were taken from.
  • Factors run in order on the server, such as keycard then PIN.

Face recognition

  • Masks, glasses, helmets and hats block a scan. The server reads them from the ped, so a client cannot lie about its face.
  • An allow-list for see-through drawables, a fallback to fingerprint or PIN, a liveness step.
  • Denied faces can be clipped on np_cctv cameras.

Wall devices

  • Our own props: a keypad, a card reader and a fingerprint reader, plus a keycard for the hand. Optional, off by default, vanilla models as the fallback.
  • Placed per door with /doordevice, streamed by np_prophandler, checked by the server.
  • Status LEDs: red locked, green open, a red flash on a wrong PIN, blinking on an alarm. Card tap, PIN entry and fingerprint animations.

3D keypad

  • The camera eases in on the wall keypad and you click its keys. Its own screen shows the masked code, tries left and the result.
  • Each press has its own clip and a key light: players within 15 m can watch the finger, so a code can be shoulder-surfed, with binoculars too.
  • The server relays the key, never the code, in range and rate limited. Switchable per server.

Breaching

  • Lockpick, the police battering ram, thermite, hacks, keypad cracking, drills and multi-step chains, all through np_minigames.
  • The ram needs a police job and the door_ram item, and logs a warrant reference.
  • Rammed, burnt and drilled doors stay open until a repair kit or staff fix them.

Alarms and dispatch

  • Silent or loud alarms on a breach, a keypad lockout or a denied face.
  • They reach the dispatch chain (np_mdt, ps, cd or qs-dispatch, or a built-in blip), np_cctv clips, np_surveillance intel and the owner's phone.
  • Weekly schedules: open to the public or forced lock by the hour, auto-lock and timed unlocks.

Keys app

  • Digital keys in np_phone: lock and unlock in range, np_cellnet jammers block the remote.
  • Share once, for some hours, forever or in a daily window, allow re-sharing, revoke.
  • Security alerts: lockpick attempts, wrong codes, used shared keys, forced doors.

Manager and creator

  • A door manager for staff, and a scoped one for owners: rules, lock chain, crime, schedule, log.
  • An in-world creator: aim at a door, double doors pair themselves, preview the swing and test-open.
  • Importers for ox_doorlock, qb-doorlock and nui_doorlock.

Drop-in for ox_doorlock

  • ox_doorlock exports (getDoor, getDoorFromName, setDoorState) and the qb-doorlock server event, so ox-style scripts and np_prison's lockdown drive np_doors.
  • Streaming by grid cells, no GlobalState per door: 1000+ doors cost nothing while nobody is near.

Staff and scripts

  • np_admin permissions (np_doors.manage, .create, .override, .lockdown, .logs), settings, audit log and spam flags. No ACE.
  • Exports, events and an np_addon host for new lock types, access sources and breach methods.
  • English and German.

A closer look

Keys, keycards, keypads and fingerprints

After the access rules, a door can ask for a chain of factors. Each step is a reader on the screen and a check on the server.

Keycard reader at Humane Labs: the lab keycard from np_inventory accepted with three uses left, then step 2 of 2, the PIN
  • Key: a door_key item cut for a door or a group, with a serial and a label in np_inventory.
  • Keycard: a group and a level the reader checks, uses that count down and an expiry. A master group opens every group.
  • Keypad: codes stored as sha256 with a per-door salt, a lockout after too many tries and an optional alarm, or a keypad managed by np_passwords.
  • Fingerprint: enrolled per door. Gloves fail, and a forged print counts as the person it was lifted from.
  • Chains: any order, such as keycard then PIN. Digital keys skip the chain if you want.

Face recognition that a mask beats

The server reads the ped itself before it decides, so the reader shows exactly what is in the way.

Face covered: the mask is detected over mouth and nose, with Remove mask and the fingerprint fallback
  • Masks (component 1), glasses (prop 1), full-face helmets and optionally hats block the scan. The checklist shows head, eyes and mouth.
  • Allow-list per model for clear glasses or open helmets, and np_clothing's mask check when it runs.
  • Fallback to fingerprint or PIN per door, and a lockout after too many tries.
  • Snapshot: a denied face is a clip on the np_cctv cameras around the door.

A keypad, a card reader and a fingerprint reader on the wall

Three props of our own, modelled for np_doors, plus a keycard for the hand. Optional and off by default: the readers work without them, and the server decides as before.

np_door_keypad, np_door_cardreader and np_door_biometric on a wall, each with its status LED lit
  • The props: np_door_keypad, np_door_cardreader, np_door_biometric and the hand prop np_door_keycard, with LODs and no logos. Without them, vanilla models stand in.
  • Placement: /doordevice <door> [keypad|card|finger|off] opens np_prophandler's placement ghost on the walls around the door. The server checks the distance to the door and saves the pose.
  • Status LEDs follow the door: red locked, green open, a red flash on a wrong PIN, blinking while the alarm runs. Drawn only within 8 m.
  • Animations: the player steps up and taps the card, types the code or lays a finger on the sensor. Upper body only, Escape stops it.
Animation: tapping the keycard on np_door_cardreader, the card held upright in front of the fingertips
Animation: typing 2 5 8 0 # on np_door_keypad, one press clip per key, seen from below the hand
Animation: laying a finger on the sensor of np_door_biometric

Card tap, PIN entry and fingerprint scan, rendered on a reference body (not part of the resource). Every frame is posed procedurally and checked against joint limits for the wrist, the elbow and the thumb, so no hand bends further than a real one; the build fails otherwise. The props, LEDs and clips are not checked in game yet.

The 3D keypad: type the code on the wall

At an np_door_keypad the PIN step opens on the prop itself, and the people around you can see which keys you press.

The 3D keypad (mockup over a prop render): three of four digits typed, key 5 lit under the cursor, and the key hints below
  • Camera: the player steps up, the camera eases in on the keypad and the HUD steps aside. Click the keys, or type 0-9, * to clear, # or Enter to open, Escape to leave.
  • A live screen: the keypad's display is a web page on the prop (a DUI) with the masked code, tries left, Access granted and the lockout countdown.
  • Observable: a press clip per key and a key light with the beep. Players within 15 m see the finger go to the key, so a code can be read over a shoulder or through binoculars.
  • Server-checked: the code goes to the server once, with the same tries, lockout and alarm as the NUI keypad. The relay carries one key, never the code, only from a player at that keypad, rate limited and only to players in range.
  • Your call: Config.Devices.keypad switches it off, or only the relay or the per-key clips, for keypads whose code must stay private. Vanilla devices and np_passwords keypads keep the NUI keypad.

The keypad's own screen

While you type, the display on the prop is a live page: the masked code, Access granted, a wrong code with the tries left, and the lockout counting down. Only your client swaps the texture; the others see the idle screen and your finger.

The camera, the click mapping and the screen swap are built and covered by the Lua tests. The in-game check is still to come.

The keypad screen states: Enter code with three of four digits, Access granted, Denied with two tries left, Locked 1:57

Breaching through np_minigames

np_doors has no minigame code. Every method is a server-validated game in np_minigames, so a door only opens for a real win.

The battering ram game of np_minigames: winding up, the swing meter with its sweet spot, the door at 66 of 120 and the stamina bar
Methodnp_minigames game
Lockpicklockpick, with the lockpick item that can break on a fail
Police ramram, the battering ram added in np_minigames 1.2.0 (skillcheck on older versions). Police job and door_ram item, a warrant reference in the log, the door breaks
Thermitethermite, the door breaks
Hackhexhack or wires
Keypad crackingcrack
Drilldrill, the door breaks
Multi-stepSeveral games in a row with Chain, such as a hack then thermite

A broken door stays open until it is repaired with a door_repair_kit or by staff. A failed attempt can set off the alarm, and every door has a cooldown.

The door manager

/doors or the np_admin action opens it for staff. Owners of a business or a property get a scoped version with only their doors.

The door manager with the buildings, the doors of Mission Row PD, who can open the front doors, behaviour, the weekly schedule and the activity log
  • Buildings and groups: every door by building and group with its state, a search and a building lockdown.
  • Who can open it: rules, grants, enrolled fingerprints and faces, issued keys.
  • Lock and crime: the factor chain, and per breach method its game, difficulty and item, with the cooldown, noise and alarm.
  • Schedule: a weekly grid of open to the public and forced lock hours, auto-lock, hold-open and the sound pack.
  • Activity: who opened, who was denied and why, kept for 14 days.

The in-world creator

/doorcreate: aim at a door and set it up where it stands. No coordinates to copy.

The creator: two door entities paired as a double door, the swing preview, name, building, type, lock and auto-lock
  • Aim and click: a raycast finds the door entity, and the partner of a double door is paired automatically.
  • Swing preview in the world and a test-open before you save.
  • Importers: /doors import ox|qb|nui reads ox_doorlock's table, qb-doorlock's and nui_doorlock's configs. A second import skips what is there.
  • Ignored models: np_banking's vault, teller and gate doors are never registered.

The Keys app

A store app in np_phone. Without the phone, digital keys still work at the door.

Keys app: my keys with remote lock buttons and the recent activitySharing a key for 2 hours with Leon Weber, only between 08:00 and 20:00
  • Remote: lock and unlock within 25 m. An np_cellnet jammer blocks it.
  • Share once, timed, forever or in a daily window, with or without re-sharing, to a player, a phone number or an identifier.
  • Revoke any key you gave out.
  • Security alerts: lockpick attempts, wrong codes, shared keys used and doors forced, as banners and in the app.

With the np_* stack

Three hard dependencies. Every other sibling is detected at start, picked up when it starts later, and has a fallback.

ResourceWhat it does with np_doors
np_prophandlerThe door engine (required): DoorSystem natives, streaming and sync for every door
np_minigamesEvery breach (required), the battering ram included
np_faction, np_gangsJob rules over all of a player's jobs with grade and duty, gang rules with ranks
np_phone, np_cellnetThe Keys app, banners and owner alerts; jammers block the remote
np_cctv, np_surveillanceClips of alarms and denied faces on the cameras within 25 m; door alarms filed as intel
np_mdt, ps, cd, qs-dispatchThe dispatch chain for alarms, with a built-in blip and toast as the last step
np_passwordsKeypads whose code lives in np_passwords
np_shops, np_housingPublic doors that follow a shop's opening hours; property access, the doorbell and let-in
np_prisonIts routine lockdown reaches np_doors through the ox_doorlock shims
np_clothing, np_characterThe mask check for the face reader; character rules and names
np_hud, np_menu, np_colshapeToasts with the auto-lock timer and progress bars; target mode; the label range
np_adminPermissions, the settings page, the audit log, the Door manager action and the server theme

Set it up

Compatibility

oxmysql, np_prophandler and np_minigames are required. ESX and np_inventory come first, everything else goes through bridges. No ACE is used anywhere.

KindSupported
Frameworkes_extended first, then qbx_core, qb-core or standalone
Inventorynp_inventory first (items registered at runtime), then ox_inventory, qb-inventory (ps, lj) or none
Requiredoxmysql, np_prophandler (the door engine), np_minigames (every breach; 1.2.0 for the ram)
InteractionWorld cards and keys, or target mode with np_menu, ox_target or qb-target
Wall devicesOptional, off by default: np_door_keypad, np_door_cardreader and np_door_biometric streamed through np_prophandler, with vanilla models as the fallback
Dispatchnp_mdt, ps-dispatch, cd_dispatch, qs-dispatch or the built-in blip and toast
Other door scriptsox_doorlock exports and the qb-doorlock server event answered by np_doors; importers for ox_doorlock, qb-doorlock and nui_doorlock
Staffnp_admin permission nodes, settings and audit log, or Config.Admins and the framework's admin groups

Installation

Start the three dependencies first. The tables are created on start, and optional siblings can start in any order.

  1. Put the resource in resources/ as np_doors and start it after its dependencies, your framework and your inventory:
    ensure oxmysql
    ensure np_prophandler
    ensure np_minigames    # 1.2.0+ for the battering ram
    ensure es_extended     # or qbx_core / qb-core (optional)
    ensure np_inventory    # or ox_inventory / qb-inventory (optional)
    ensure np_doors
  2. The database schema is applied by the resource itself. sql/install.sql is the same SQL for importing by hand.
  3. Items: nothing to do with np_inventory. On ox_inventory or qb-inventory, paste the block from docs/items.md (door_key, keycard, door_ram, door_repair_kit, forged_print).
  4. Staff: give np_doors.manage (and .create, .override, .lockdown, .logs) in np_admin, or list identifiers in Config.Admins without it.
  5. Bring your doors over with /doors import ox|qb|nui <resource>, or set them up with /doorcreate.
  6. Wall devices (optional): set Config.Devices.enabled = true in shared/config/50_devices.lua and place them with /doordevice <door> [keypad|card|finger]. If np_prophandler limits client attachment models, add np_door_keycard there.
  7. The NUI ships prebuilt in releases. To build it from source:
    cd web && npm install && npm run build

For your own scripts

Server exports to read and drive doors, grant access and hand out keys, register lock types, access sources and breach methods, and server events.

-- a housing script: owners open their own doors, and a guest is let in for 30 s
exports.np_doors:registerAccessSource('property', function(src, door, rule)
  return OwnsProperty(src, rule.subject), 'Your apartment'
end)
exports.np_doors:TimedUnlock('apt12_front', 30, src)

-- a 2 hour key for a friend, and a keycard for the lab
exports.np_doors:giveKey(target, 'storage_14', { mode = 'timed', hours = 2 })
exports.np_doors:giveKeycard(src, { group = 'humane', level = 3, uses = 5 })

-- lock a whole building down
exports.np_doors:lockdown('Mission Row PD', true)

AddEventHandler('np_doors:breach', function(id, src, method, success)
  if success and method == 'ram' then LogRaid(id, src) end
end)

Events: np_doors:stateChanged, np_doors:ring, np_doors:breach, np_doors:alarm and np_doors:lockdown; updateDoor(id, { device = { coords, heading, kind } }) places a wall device. ox_doorlock shims: getDoor, getDoorFromName and setDoorState. Addons attach through np_addon.

Questions

Why does it need np_prophandler and np_minigames?

np_prophandler is the door engine: it runs the DoorSystem natives, streaming and sync for every door, so np_doors only owns the rules, readers and timers. np_minigames runs every breach with a server-side replay, so a door only opens for a real win. np_doors has no minigame code of its own.

Can I keep my ox_doorlock or qb-doorlock doors?

Yes. /doors import ox|qb|nui reads ox_doorlock's table and the configs of qb-doorlock and nui_doorlock. With ox_doorlock gone, its exports and the qb-doorlock server event are answered by np_doors, so scripts written for them keep working.

Can a player fool the face reader?

Not from the client. The server reads the mask, glasses, helmet and hat slots of the player's ped before it decides, with an allow-list for see-through drawables. A covered face falls back to fingerprint or PIN if the door allows it.

What happens to a rammed door?

Ram, thermite and drill break the door: it stays open and cannot lock until somebody repairs it with a door_repair_kit or staff fix it. The ram needs a police job and the door_ram item, and the warrant reference goes into the log.

Do I need the wall props?

No. Config.Devices.enabled is off by default: no prop, no LED, no per-frame work, and the readers open as screens. Turn it on and place a device per door with /doordevice; when the np_door_* models are not streamed, vanilla keypad, card and fingerprint models stand in.

Can other players really read a code?

On the 3D keypad, yes, on purpose: every press has its own clip, the key lights up and beeps, and the server tells players within 15 m which key was pressed. It never sends the code and decides nothing from a relayed key. For a keypad whose code must stay private, switch off observable.relay and observable.anim, or the 3D keypad altogether.

Do 1000 doors slow the server down?

No. There is no GlobalState per door: players get the door list once and state changes only for their grid cell and the eight around it.

Has it run on a live server yet?

Yes, on an ESX dev server (FXServer 25770, game build 3751). Tested in game: the world labels, locking and unlocking with E, knocking, auto-lock, the server exports, lockdown, keys, the manager, the in-world creator, the phone Keys app, and the wall keypad and card reader with their status LEDs. The world, manager and creator screenshots are captures from that server. Not tested in game yet: the reader steps and the 3D keypad as a non-staff player (staff skip the lock chain), and the device animations. The Lua test harness and the NUI tests cover the rest.

Does it need np_inventory or np_admin?

No. np_inventory is the first choice and gets the items registered by np_doors, with ox_inventory, qb-inventory or no inventory as fallbacks. With np_admin you get the permission nodes, settings and audit log, without it Config.Admins and the framework's admin groups. ACE is never used.

Is it in German?

English and German, set with Config.Locale.

Works well with

Ensure it, import your doors, lock them.

Installation, every config key and every export are in the docs.

Install np_doors