Skip to content

Integrations ​

np_drugs requires np_npchandler and np_prophandler (below). Every other np_* resource is optional. Each optional sibling has one file under integrations/ that declares the exports it calls and wraps them with a built-in fallback. At start (server and client console) one line per sibling is printed: active, fallback: …, missing export <name>, off in config or not running. Siblings may start or stop later: the status is re-evaluated, and shops and the phone app are registered again. Config.Integrations.<name> = false forces the fallback.

tests/test_integrations.lua reads the sibling repositories next to np_drugs and fails when a declared export is gone, or when a file calls an export it did not declare.

Sibling With it Without it
np_inventory Items with metadata, item actions, use callbacks, stashes, trunks, evidence lockers, searchable bins, shops, purchase receipts ox_inventory / qb-inventory / ESX inventory (Compatibility)
np_hud Toasts with their header line, progress bars, prompts, zone claims for the tile strip and the load meter The same pieces in np_drugs' own NUI layer
np_menu Options on peds, props, vehicles and players (offer product, bins, benches, search, check on someone) Walk up and press the interact key
np_phone The Vitals app, phone notifications for cravings and rehab Toasts; a doctor at a clinic shows the same
np_character The character id on standalone servers FiveM license
np_shops The pharmacy, hardware store, corner store and back room as np_shops shops; receipts for supplies bought in any np_shops shop Shops and receipts through the inventory
np_admin Staff rights by permission node, live settings (Drugs), staff tools, the audit log (category np_drugs) np_drugs' own admins (framework groups, Config.Admins, Discord roles) hold every node; settings in the files
np_discord Admins by Discord role (without np_admin) Framework admin groups and Config.Admins
np_minigames Attended lab stages as a series of server-validated balance checks (Config.Minigames, see Production → Lab minigames) The built-in lab meter (A / D, W to vent)
md-stempeluhr (MDT) The medical record in the MDT over its HTTP API Records stay in np_drugs
ps-dispatch, cd_dispatch, qs-dispatch, core_dispatch Witness reports in their call lists The built-in toast and blip for police on duty
np_gangs Corners, turf prices, gang stamps, lab slots and permits, the outsiders' tax. np_gangs holds the adapter; np_drugs has no gang code Personal stamps, the basic street sale, labs wherever Config.Production.sites allows
np_environmental Calls np_drugs: chemical scenes prefer spawn points near placed labs (GetLabs); 911 reports go out through Dispatch (kind environmental) while np_phone is not running –
np_prison Calls np_drugs: illegal products are contraband, no sales or production while jailed, a drug test at intake –
np_farming Calls np_drugs: reads GetProductionLines and keeps shared ingredients (corn, fertilizer) as farm items; a trusted adapter may add crops through np_farming's RegisterCrop –

np_npchandler / np_prophandler (required) ​

Both are dependencies in fxmanifest.lua (1.1.0+) and must start before np_drugs. np_drugs creates no ped or prop itself: there is no fallback and no Config.Integrations toggle for them. Street sales still task ambient peds that np_drugs did not create.

What Handler
Props in the hand (timed actions) np_prophandler attachment: synced on the player, local on another ped
Lab equipment np_prophandler local props, placed on the ground; the first piece carries the lab prompt, hidden while you can't act (a lab without a drawable piece gets a plain prompt). Drawn again on the client np_prophandler:ready
Used syringes on the ground np_prophandler props registered by the server, in the drop's routing bucket, with the pick-up option; removed when picked up or swept. Registered again on the server np_prophandler:ready
K9 dog np_npchandler networked ped the officer's client creates; deleted when the dog is dismissed
Rehab doctor np_npchandler local NPC per clinic with the desk option (a plain prompt when no doctor model is set). Added again on np_npchandler:ready

np_gangs ​

np_drugs has no file for np_gangs: np_gangs calls np_drugs' public API from its own adapter. What each side does, step by step, is on np_gangs + np_drugs.

np_shops ​

  • The shops of Config.Production.shops (npd_pharmacy, npd_hardware, npd_grocery, npd_backroom) are registered with exports.np_shops:RegisterShop as shops owned by np_drugs, and again after np_shops restarts (np_shops:server:ready). Without np_shops, or for a shop np_shops refuses, they are inventory shops (np_inventory / ox_inventory RegisterShop).
  • np_drugs registers one beforeBuy hook with np_shops. It never vetoes; it writes the purchase trail (who bought which ingredient or piece of equipment where) after the hook has returned. A receipt is kept for every np_shops shop that sells such an item, except np_drugs' own shops with trail = false. The police terminal shows np_shops' label for the shop.

np_admin ​

np_drugs vendors np_admin's lib byte-identical in bridge/np_admin.lua. When np_admin runs:

  • Permission nodes (category Drugs): np_drugs.admin, .items, .training, .body, .debug (Installation → Permissions).
  • Resource settings → Drugs: Configuration → Editable in np_admin. The settings are registered again on np_admin:ready and listed while np_drugs is stopped.
  • Staff tools: np_drugs.status, np_drugs.give_batch (an imported batch of any substance, bulk items to the player), np_drugs.give_item (any np_drugs item, a drug item of a batch by id), np_drugs.training, np_drugs.body (body state in numbers), np_drugs.sober (clears every dose, blood alcohol and an overdose; full also resets tolerance, dependence and cravings). Each accepts its own node or np_drugs.admin.
  • Audit log category np_drugs: staff actions (batch_import, staff_give, staff_training, staff_sober, staff_body_reset) and the entries of Config.AdminLog. Everything also stays in np_drugs_log.

Known gaps in the siblings ​

Gap How np_drugs lives with it
np_inventory sends full metadata to everyone who sees a slot The contents of a packed item live server-side under an opaque lot id; ordinary containers carry a decoy lot
np_inventory fires no added / removed event for a drag between two inventories np_drugs reads its beforeMove / onDrop hooks read-only and reconciles when a trunk is opened or closed
np_hud's status row is a fixed list The substance tiles and the load meter are np_drugs' own layer, with np_hud zone claims
md-stempeluhr has fixed event types and no alert endpoint Entries map to patient, vitals sample and treatment record; bad batch alerts stay in np_drugs
np_inventory has no RemoveShop A shop the inventory took over while np_shops was stopped stays there until np_drugs restarts