Skip to content

np_drugs v1.0.0 ​

A drug system where three loops feed each other, built on the Nimbus UI design system:

  • Product: grow, cook, press and distil in labs that leave traces; cut, portion and stamp a batch at the batch table; hide product in a soda can or a cereal box; carry it in a car where it can burst.
  • Body: eight substances with one upside and one price each, a load meter with an overdose line that moves with tolerance, dependence in four stages, cravings, withdrawal, overdoses, EMS, a medical record and a 14-day rehab.
  • City: police searches with contraband training, K9 units, breath, swab and blood tests, evidence with batch ids, prints and purchase trails, witness reports, bins that clear after 24 hours and a sanitation job, and a basic street sale to passers-by.

It runs on es_extended, qbx_core or qb-core, or standalone, with np_inventory, ox_inventory, qb-inventory or the ESX inventory. es_extended with np_inventory is the first target. The hard dependencies are oxmysql, np_npchandler and np_prophandler (both 1.1.0+). Staff rights are np_admin permission nodes (no ACE); police, medics and sanitation workers come from your framework's jobs. np_gangs plugs in through the public API for corners, turf prices, gang stamps and lab permits; neither resource needs the other (np_gangs + np_drugs).

The batch table: cut, portion, stamp

Production: a meth cook Concealment bench
Production Conceal
The packer's card, trunk wear Police search
Carry Search
Evidence and the purchase trail Using: the load meter and the body HUD
Evidence High
The eight substances EMS: tox screen and treatment
Substances EMS
Breath, swab and blood Trashcans
Tests Trash
Street sale Police terminal
Street Terminal

The screenshots come from the browser mock (see Development). The UI ships in English and German; the dense screens also exist as German shots (*.de.png).

Principles ​

  • Items, not menus. A packed can is an inventory item with hidden contents. There is no /drugs command and no separate drug inventory.
  • One upside, one downside. Every substance gives a character a reason to take it and a price while high.
  • Words, not numbers. Players read "Hooked" and "your hands are shaking", never addiction = 63. Numbers are for medics and tests.
  • Every step leaves something behind. A cut can, a used syringe, a batch id, a smell. That is what police, EMS and trash workers play with.
  • Time is the cost. Searching, packing, testing and digging take seconds on a progress bar, so each one is a decision.

At a glance ​

  • Batches, not just items. Every product carries a batch id; one id always means one purity. Cutting derives a new batch that points back to its parent, so tracing walks the chain. Grades A to D; the purity only after a test kit. See Product loop.
  • Stamps and reputation. One personal stamp per character (gangs supply their own). Reputation comes from how highs really went; a bad batch costs it, and buyers pay accordingly.
  • Production in six lines (grow, process, cook, refine, press, distil): attended stages the server scores, long stages on persistent timers, purity from ingredients, equipment, care and practice. Labs leave waste, smell, fumes, a jump on the power meter and receipts. See Production.
  • Concealment and trunk wear. Hollow out a container, pack it, seal it. Only the packer sees inside. A packed item in a car uses up its safe time and then may burst; nobody is told.
  • Selling through one sale engine: np_drugs' basic street sale to passers-by, or np_gangs' corners when it runs. See Selling.
  • The body. A method picker, effects computed on the server, mixing rules, tolerance that only counts once it has settled, dependence, cravings, withdrawal, overdoses. See Body loop.
  • EMS, record and rehab. Tox screen, a treatment tray where a medic can pick wrong, a nasal spray friends can carry, bad batch alerts without a name, the medical record mirrored to the MDT, a 14-day program and the Vitals app in np_phone.
  • Police. One careful look per officer and item, contraband training taught at the academy, consent or a K9 alert to open, evidence with batch, prints and receipts, a police terminal. See Police & EMS tools.
  • City. Every bin and dumpster is a shared container cleared after 24 hours, a sanitation job with a board and routes, witness reports through your dispatch. See City loop.

Who uses it ​

Resource What it does with np_drugs
np_gangs Corners, turf prices, gang stamps, lab slots and permits, the outsider tax. See np_gangs + np_drugs
np_prison Illegal products are contraband; no sales or production while jailed; a drug test at intake, optionally court-ordered rehab
np_shops Hosts np_drugs' pharmacy, hardware store, corner store and back room; its purchases feed the paper trail; np_drugs' Dispatch as a dispatch choice
np_phone The Vitals app
MDT Overdoses, tests, treatments and rehab in the medical record (over the MDT's HTTP API)
np_admin Permission nodes, the settings page Drugs, staff tools, the audit log (category np_drugs)

All of them are optional. See Integrations.

Quick example ​

lua
-- server: what is this item, and what would it fetch here?
local info = exports.np_drugs:GetItemInfo(item)          -- { substance, units, grade, stamp, batch, … } or nil
local quote = exports.np_drugs:GetPrice(item, coords, src) -- { price, factors = { grade, stamp, demand, opened }, … }

-- server: sell through the engine from your own resource (hooks, payment, reputation, `sold` event)
local ok, result = exports.np_drugs:Sell(src, { slot = 3, count = 2, channel = 'my_resource' })

-- server: a court orders rehab
exports.np_drugs:OrderRehab(target, 'opioid', { by = 'Judge Hall', clinic = 'pillbox' })

-- server: hear about bad batches
AddEventHandler('np_drugs:server:badBatch', function(p)   -- { batch, stamp, overdoses, reportedBy }
  print(('bad batch %s under stamp %s'):format(p.batch, tostring(p.stamp)))
end)

Next steps ​