Common concepts ​
The np_* resources share a set of patterns. Each resource's Bridges page has the details for that resource.
Bridges and auto-detection ​
Resources never call a framework or voice resource directly. They go through a bridge: a small Lua table with a fixed
contract (for example Phone.Framework.getMoney(src, 'bank') or Hud.Voice.get()), plus one implementation file per
supported resource.
bridge/framework/client/1_qbx.lua
bridge/framework/client/2_qb.lua
bridge/framework/client/3_esx.lua
bridge/voice/…
- Every bridge file starts with
Bridge.shouldLoad(kind, name, resource)and returns early unless its resource is started and selected. Config.Framework/Config.Voiceselect a bridge.'auto'takes the first one that is started. The files are numbered so thatautoprefers qbx over qb (qbx also providesqb-core) and pma-voice over the other voice resources.- Optional exports are called through
pcall, so a missing or broken dependency degrades a feature instead of throwing errors. - Detection runs once at resource start, so start optional dependencies first in
server.cfg. - np_prophandler and np_npchandler are not bridged. The resources that spawn props
or NPCs list them in
dependenciesand have no fallback, so start them first. - np_mdt is the exception to the naming above: it also bridges target, UI and database, prefers ESX, and is
overridden with
Config.Bridge. See MDT bridges.
| Kind | Supported | Fallback |
|---|---|---|
| Framework | qbx_core, qb-core, es_extended |
np_hud: standalone · np_phone: required · np_menu: standalone · np_character: standalone (own tables) · np_clothing: standalone (license identifiers, no economy: purchases are free, no jobs or duty) · np_tattoos: standalone (license or np_character, no economy) · np_identification: standalone (no economy, no jobs) · np_inventory: standalone (np_admin group nodes, own money table) · np_banking: standalone (license identifiers, own balances, no cash) · np_payments: standalone (in-memory wallet, np_admin job nodes) · np_fuel: standalone (no economy: fuel is free, a station's balance is a score) · np_shops: standalone (cash as an inventory item, jobs from Config.StandaloneJobs) · np_vending: standalone (license identifiers, no economy: every price is skipped) · np_metal-scanner: standalone (license identifiers or a character state bag, jobs from Config.StandaloneJobs, no economy: locker fees are free and shift pay is not paid) · np_fishing: standalone (license identifiers, no economy: nothing costs, nothing pays) · np_golf: standalone (np_character or license identifiers, an in-memory wallet, no jobs) · np_darts: standalone (np_character or license identifiers, an in-memory wallet, pub owners by identifier) · np_billiards: standalone (np_character or license identifiers, an in-memory wallet, jobs from np_admin nodes) · np_minigames: standalone (license or np_character identifiers; the framework is only used for names) · np_prison: standalone (license or a character state bag, jobs from Config.StandaloneJobs, no economy) · np_surveillance: standalone (license identifiers, no economy, no jobs: only staff reach cases) · np_cctv: standalone (license identifiers, no economy: nothing costs; staff place gear with commands) · np_spy-pigeon: standalone (flying by np_admin node or the fallback list, no jobs, so the Crow stays locked) · np_gangs: standalone (no economy: every price is skipped) · np_drugs: standalone (jobs from Config.StandaloneJobs, dirty cash as an item) · np_farming: standalone (np_character or license identifiers, jobs from Config.StandaloneJobs, no economy: selling is off, rent and fees are free) · np_environmental: standalone (license identifiers, everybody a civilian unless RegisterFaction says otherwise, no economy) · np_screens: standalone (access from the admin node, owners and grants; no job rules) · np_helicam: standalone (np_admin role nodes) · np_flightradar: standalone (onboard, phone; admin and ground radar via np_admin nodes) · np_mdt: standalone · np_manufacturing: standalone (np_admin role nodes) · np_crouch-crawl-shoot: standalone (the framework is only used for dead / cuffed checks) · np_admin: standalone (no jobs or money actions) · np_discord: standalone (the framework is only used for job roles) · np_prophandler: standalone (the framework is only used for job and gang conditions, which never match without one) · np_npchandler: standalone (the framework is only used for job and gang conditions; NPCs that need them stay unavailable without one) · np_passwords: standalone (np_character or license identifiers; no jobs, so no job-owned locks, job vaults or warrant reads) · np_net: standalone (no framework used; shim es_extended to see ESX callbacks) · np_cellnet: standalone (license identifiers, no jobs, no economy: plans cost nothing, repairs pay nothing) · np_faction: standalone (np_faction keeps the job itself in a state bag; every linked faction is a job) · np_entertainment: standalone (no jobs: only grants open ent.* features) |
| Voice | pma-voice, saltychat, yaca-voice |
none: talking indicator only / UI-only calls (np_prison: visitors and collect calls talk by proximity) |
| Banking | np_payments: np_banking (first), Renewed-Banking, qb-banking / qb-management, okokBanking, esx_addonaccount. np_banking itself is a banking resource: its checking account is the framework bank, so scripts that use the framework bank keep working |
Framework cash and bank, no job accounts. See np_payments bridges and np_banking bridges |
| Inventory | ox_inventory, then the framework inventory. np_inventory answers both APIs (np_fuel: np_inventory, ox_inventory, qb-inventory · np_prison, np_drugs and np_farming: np_inventory, ox_inventory, qb-inventory, the ESX inventory · np_gangs and np_environmental: np_inventory, ox_inventory, qb-inventory · np_passwords: np_inventory, ox_inventory, qb-inventory · np_vending: np_inventory, ox_inventory, qb-inventory · np_metal-scanner: np_inventory, ox_inventory, qb-inventory, the ESX inventory · np_fishing: np_inventory, ox_inventory, qb-inventory · np_surveillance and np_cctv: np_inventory, ox_inventory, qb-inventory · np_spy-pigeon: np_inventory, ox_inventory, qb-inventory, the framework's own · np_golf and np_darts: np_inventory, ox_inventory, qb-inventory, the ESX inventory · np_billiards: np_inventory, ox_inventory, qb-inventory, the ESX inventory · np_minigames (opts.item): np_inventory, ox_inventory, qb-inventory, the framework's own · np_cellnet: np_inventory, ox_inventory, qb-inventory · np_faction: np_inventory, ox_inventory, qb-inventory · np_entertainment: np_inventory, ox_inventory, qb-inventory) |
– (np_identification: digital documents only · np_fuel: no receipts, no jerry can · np_prison: no items, empty property bag · np_environmental: tasks that need an item cannot be done, place tasks by prompt · np_passwords: no items or stash locks; cracking and warrant reads need no item · np_vending: no carried stock, machines are restocked by the city or staff · np_metal-scanner: no items, so wands, tickets and ground finds are unavailable; gates still read GTA loadout weapons, and seizures stay in the case record · np_surveillance: no items, so no laptop and no field devices; the console opens by command, key or terminal · np_cctv: no items; staff place gear with commands, and USB sticks and case hand-over are unavailable · np_spy-pigeon: the counter items (bread, jammer, spikes, scanner, caught pigeon) are unavailable · np_fishing: a virtual tackle box and cooler per character · np_golf: a rental bag and range balls · np_darts: house darts, sets kept in the profile · np_billiards: the house cue and house chalk · np_minigames: opts.item is ignored · np_cellnet: the carrier lives on the character; no jammers, detectors or repair parts · np_faction: no armory, stashes, lockers or tablet item · np_entertainment: no ticket, flyer or mic items) |
| Fuel | np_fuel first (np_hud, np_helicam, np_inventory's jerry can), then ox_fuel, LegacyFuel, cdn-fuel, ps-fuel. np_hud picks again when a fuel resource starts or stops. See np_fuel bridges |
The native fuel level |
np_fire uses ESX first and calls np_inventory (with an ox_inventory fallback) for its equipment checks. Its simulation core can run without a framework; job actions require np_jobs and fail closed when unavailable. Other inventory adapters are not part of the current runtime.
Addons ​
Some resources extend another one instead of standing alone: np_cellnet is an addon of np_phone,
np_spy-pigeon an addon of np_surveillance, np_medic_field an addon of np_medic. An addon declares its host in its manifest
(np_addon 'np_phone'), registers everything through the host's public exports, and re-attaches by itself after a
restart of either resource, so the start order doesn't matter. The host never depends on the addon. How to write a host
or an addon: Addons.
Configuration ​
shared/config.luaholds the core settings. Bigger resources split areas intoshared/config/<area>.lua(for exampleConfig.Comms,Config.City).- Config files are shared (loaded on client and server), so anything in them is visible to players.
Secrets ​
Tokens, webhooks and peppers never go in a config file. Read them from server convars in server.cfg,
using set and not setr, so they aren't replicated to clients:
set np_phone:fivemanage_token "your-api-key"
NUI ​
- Each resource has a
web/folder (Vite + React + TypeScript strict) that builds toweb/dist. - Lua → NUI:
SendNUIMessage. NUI → Lua:fetch('https://<resource>/<name>')NUI callbacks. - Every resource documents its message contract (see np_hud NUI contract, np_phone architecture, np_menu NUI contract, np_character NUI contract and np_clothing NUI contract, np_tattoos NUI contract, np_identification NUI contract, np_inventory NUI contract, np_payments NUI contract, np_banking NUI contract, np_fuel NUI contract, np_shops NUI contract, np_vending NUI contract, np_metal-scanner NUI contract, np_fishing NUI contract, np_golf NUI contract, np_darts NUI contract, np_billiards NUI contract, np_minigames NUI contract, np_gangs NUI contract, np_drugs NUI contract, np_farming NUI contract, np_environmental NUI contract, np_passwords NUI contract and np_admin protocol summary).
npm run devruns the NUI in a browser with mock data, so you can work on the UI without a FiveM server.
Permissions & np_admin ​
No np_* resource uses FiveM ACE. There are no add_ace or add_principal lines and no IsPlayerAceAllowed calls.
Each resource vendors np_admin's lib (bridge/np_admin.lua) and checks permission nodes, dotted
strings like np_inventory.admin or np_helicam.air, with npAdmin.can(src, node).
- With np_admin running, staff grant nodes to groups or single players in its Permissions
page. Wildcards work (
np_inventory.*) and an explicit deny always wins. Resources register their nodes, so they show up with labels in the permission matrix. - Without np_admin, np_admin is not a dependency. The lib then allows only:
- the server console;
- the identifiers in the convar
np_admin_fallback; - on es_extended, the ESX groups in
np_admin_fallback_groups(defaultadmin,superadmin).
set np_admin_fallback "license:abc…,discord:123…"
set np_admin_fallback_groups "admin,superadmin"
Everyone else is refused, including standalone job and group nodes (they need np_admin). Each resource's
Installation page lists its nodes. If you upgrade from an older version, remove the old add_ace lines; they are no
longer read.
Resources also forward their log entries into np_admin's audit log and can register staff actions for its quick menu and palette. Their own webhooks keep working as a fallback.
Settings in np_admin ​
Most np_* resources register part of their Config with np_admin (shared/np_admin_settings.lua). Staff then change
those values live in Resource settings, without editing files.
config.luastays the default. np_admin stores only the overrides and writes them back intoConfigat start and on every save.- Each field has an apply badge: live (applies right away), client reload (on the client's next init, e.g. a reconnect) or restart (restart the resource).
- Secrets (webhooks, tokens) are masked and only visible with
np_admin.settings.secrets. Convars still win where a resource documents it. - Without np_admin,
config.luais used as written.
Each resource's Configuration page has an "Editable in np_admin" section listing its categories.
Performance ​
- Nothing polls while it isn't needed. Loops start when there is something to do (in a vehicle, while armed, while the phone is open).
- The idle resmon target is 0.00 ms.
Security ​
- The server is authoritative. Money, items, vehicles and ownership are validated on the server, and client values are never trusted.
- NUI → server calls are rate-limited and type-checked.
- Server-local events (
AddEventHandler) fire only after validation. Never listen to the raw net events from other resources.