Bridges & integrations ​
np_passwords talks to frameworks and inventories through bridges in bridge/, and to the other np_* resources through
optional integrations. Bridges are picked once, at start (Config.Framework, Config.Inventory, 'auto' = the first
started one), so start these resources before np_passwords. Every call into another resource goes through pcall: a
missing export turns a feature off instead of breaking a prompt.
Framework ​
| Bridge | Resource | Character id | Jobs |
|---|---|---|---|
esx |
es_extended | xPlayer.identifier |
Job, grade, job.onDuty when set (else on duty), boss = grade name boss |
qbx |
qbx_core | citizenid | Job, grade, onduty, isboss |
qb |
qb-core | citizenid | Job, grade, onduty, isboss |
standalone |
none | np_character character id, else the license | From np_character, else none |
Auto-detection order: qbx_core → qb-core → es_extended → standalone. The framework gives np_passwords the character id (keychains are per character), the name (logs, vault members, warrant sheet) and the job (job-owned locks, job vaults, warrant jobs and duty). Character load and unload and job changes are forwarded, so a character switch closes open panels and a job change flags the old job vault.
The client side only reads the death state (prompts and cracking cancel when the player dies).
Standalone ​
Without a framework, np_passwords runs on np_character when it is started: its active character is the character id, its name and job are used. Without np_character, the license identifier is the character id and there are no jobs, so job-owned locks, job vaults and warrant reads don't work. Everything else (locks, keychain, gang and custom vaults, 2FA, cracking) works standalone.
Inventory ​
| Bridge | Resource | Items | Stash locks |
|---|---|---|---|
np |
np_inventory | Registered at runtime with labels, icons and a Read action on notes | Yes (beforeOpen hook) |
ox |
ox_inventory | Add them to data/items.lua with server = { export = 'np_passwords.itemUse' } |
Yes (openInventory hook) |
qb |
qb-inventory, ps-inventory, lj-inventory | Add them to the shared items; np_passwords makes them usable | No (no hooks) |
none |
– | No items. Cracking and warrant reads need no item | No |
The three items are paper_note, code_breaker and search_warrant (names in Config.Items). With np_inventory,
np_passwords registers them again when np_inventory restarts, and while a panel is open it marks the inventory busy so
it can't open on top. See Installation for the ox_inventory item block.
-- qb-core/shared/items.lua
paper_note = { name = 'paper_note', label = 'Paper note', weight = 10, type = 'item', image = 'paper_note.png', unique = true, useable = true, shouldClose = true, description = 'A code written on paper' },
code_breaker = { name = 'code_breaker', label = 'Code breaker', weight = 400, type = 'item', image = 'code_breaker.png', unique = false, useable = true, shouldClose = true, description = 'Cracks keypads' },
search_warrant = { name = 'search_warrant', label = 'Search warrant', weight = 20, type = 'item', image = 'search_warrant.png', unique = false, useable = true, shouldClose = true, description = 'Lets police read a keychain' },
On qb-core and qbx_core, np_passwords makes the three items usable itself (CreateUseableItem): the code breaker
starts cracking at the nearest lock, the warrant opens the warrant read and a paper note shows its code and offers to
save it, the same flow as with np_inventory. You only add the item definitions above.
Integrations ​
Each integration is 'auto' (use it when the resource is started), true or false in Config.Integrations.
| Key | Resource | What np_passwords does with it |
|---|---|---|
hud |
np_hud | Save / update offers as notifications with Y / N actions, owner alerts as toasts, interaction prompts at locks (E / G / H), and ClaimZones('center') while a panel is open. Without it: np_passwords' own toasts and a GTA help text |
phone |
np_phone | The Passwords app, owner alerts as notifications with deep links, the 2FA SMS, the security badge, streamer mode |
inventory |
np_inventory | Runtime items, stash locks, the busy lock while a panel is open |
gangs |
np_gangs | Gang vaults (GetGang, ranks og 3 / trusted 2 / member 1), gang-owned locks, flagging when members leave, the opt-in gang stash lock |
menu |
np_menu | Player options Watch them type (while that player types) and Read keychain (warrant) |
identification |
np_identification | The optional document check for warrant reads (Config.Warrant.document, hasValidDocument) |
character |
np_character | Character id, name and job in standalone mode |
discord |
np_discord | The keychain over Discord DMs: text DMs and the DM-only /passwords command (Config.Discord, off by default) |
minigames |
np_minigames | Cracking as its server-validated crack game, pattern locks as pattern (Config.Minigames, see Crime → Cracking with np_minigames) |
The phone app, the np_menu options, the np_inventory items and hooks and the /passwords command are registered again when those
resources restart.
np_prophandler 1.1.0+ is not in this list: it is required. Lock doors and the keypad
prop of every lock with meta.prop = 'model' and coords are np_prophandler props and doors, registered again on
np_prophandler:ready.
np_admin ​
np_passwords vendors np_admin's lib (bridge/np_admin.lua, the global npAdmin). With np_admin
running:
- permission checks use the nodes
np_passwords.admin,np_passwords.locksandnp_passwords.reveal(see Installation → Permissions); - part of the config is editable live;
- the staff actions appear under Resource tools;
- lock creation and removal, code changes, lockouts, leaks, cracks, warrant reads and keychain wipes go to the audit
log (category
np_passwords, never a secret); - the NUI follows np_admin's server theme (brand colour, strength, material).
Config.Materialoverrides only the material.
Without np_admin, the lib's fallback decides who is staff (console, np_admin_fallback, ESX admin groups).
Dispatch ​
There is no built-in dispatch bridge. Hook your dispatch resource to
np_passwords:dispatch.