All products

np_drugs

Three loops that feed each other. Product: labs, batches and concealment. Body: eight substances with one upside and one price each, tolerance, overdoses and rehab. City: searches, K9s, tests, evidence and bins. Every step leaves something behind for police, EMS and trash workers.

v1.0.0ESX · qbx · qb · standaloneRequires oxmysqlRequires np_npchandler 1.1.0+ · np_prophandler 1.1.0+
Price TBAStore link follows at release
InstallationDocumentation
Version
1.0.0
Frameworks
ESX, qbx, qb, standalone
Dependencies
oxmysql, np_npchandler 1.1.0+, np_prophandler 1.1.0+
Database
Tables created on start
Inventory
np_inventory, ox_inventory, qb-inventory, ESX
Substances
Alcohol, tobacco, weed, cocaine, ecstasy, meth, heroin, fentanyl
Optional
np_gangs, np_shops, np_admin, np_hud, np_menu, np_phone, MDT, dispatch resources
Languages
English, German
Build
Node 18+ to build the NUI once
The batch table: batch K-2041 of cocaine at 86 %, a cut of 400 g filler, 1 g portions, the stamps and what hits the street
The batch table: batch K-2041 of cocaine at 86 %, a cut of 400 g filler, 1 g portions, the stamps and what hits the street

Taken from the NUI in the browser at 1920×1080.

What's in it

A core with batches, stamps, the body and hidden contents, and nineteen modules on top of it.

Batches and stamps

  • Every product has a batch id and one purity. Cuts derive a new batch that points back.
  • Stamps build reputation from how highs really went.

Production

  • Six lines: grow, process, cook, refine, press, distil.
  • Labs leave waste, smell, fumes, a power spike and receipts.

Concealment

  • Hollow out a can or a cereal box, pack it, seal it. Only the packer sees inside.
  • Packed items in a trunk can burst. Nobody is told.

The body

  • A load meter with an overdose line that moves with settled tolerance.
  • Dependence in four stages, cravings, withdrawal, mixing rules.

EMS and rehab

  • A tox screen that finds the cut, a tray where a medic can pick wrong, a nasal spray.
  • A 14-day program and the Vitals app in np_phone.

Police

  • One look per item from contraband training, consent or a K9 alert to open.
  • Breath, swab and blood tests, evidence and a police terminal.

Trash

  • Every bin is a shared container, cleared 24 hours after its first item.
  • A sanitation job with a board, routes and the odd heavy package.

Selling

  • One sale engine for the street sale, np_gangs' corners and your scripts.
  • Grade, stamp and area demand set the price.

A closer look

Batches and stamps

One batch id always means one purity. Players see grades A to D; the purity needs a test kit.

The batch table with a cocaine batch, the cut, the portions and the stamps
  • Cut with filler for more units, or with fentanyl to make weak product feel strong. The buyer finds out.
  • Portion into street bags, standard, regulars or wholesale bricks.
  • Stamp with one of eight personal designs, or a gang stamp from np_gangs. Trusted stamps sell for more; a bad batch burns them.
  • Cutting derives a new batch whose parent points back, so tracing walks the chain to the cook.

Production

A lab is a set of placed equipment in a property, a garage or a fixed site. Its prompt only shows while you can act, not dead, cuffed or busy. np_gangs can add lab slots and permits per turf.

A meth cook: the heat stage held between the lines, fumes to vent and the purity bars
LineFrom
GrowSeeds and fertilizer in a tent under a lamp, three days with water
ProcessCoca leaves, kerosene and baking soda
CookPseudoephedrine or cold medicine and solvent
RefineRaw opium and acetic anhydride
PressSafrole oil and binder in a pill press
DistilCorn, sugar and yeast, a still and a fermenter

Purity comes from ingredients, equipment wear, care in the attended stages and practice. A boil-over starts a fire and a 911 call from next door.

Concealment and trunks

The packed item keeps the name and icon of the real product. The contents never go into item metadata.

The concealment bench: a soda can hollowed out, packed and sealed with glue
  • Three steps at any table, counter or car hood: hollow out, pack, seal with glue or tape. Gloves keep prints off.
  • Cover depends on the hour and how many you carry: a cold pizza at 4 am stands out.
  • Trunk wear: heat and a poor seal use up the safe time, then it may burst. A cooler pauses it.
  • Whoever opens a trunk where something burst smells it. The torn packaging is evidence.

The body

Effects are computed on the server and drawn by the client. Players read words, never numbers.

High: the load meter near the line, the substance tiles and a body message
SubstanceUpside · downside
AlcoholStress falls · sway, slurred voice, blackout
WeedStrongest stress relief · hunger, smell
CocaineStamina · shaky aim, a heartbeat others hear
EcstasyStress wiped · overheating, a grey day after
MethFaster work actions · phantom sounds
Heroin, fentanylPain ignored · nodding off, the worst withdrawal

Tolerance only moves the overdose line once it has settled, so coming back to an old habit's dose after a break is the classic overdose.

EMS, record and rehab

Medics treat, test and keep a record that is mirrored to the MDT. Whether they may tell the police is a server setting, off by default.

The medic's screen: vitals, the tox screen with a hidden fentanyl cut and the treatment tray
  • Tox screen lists what is in the system, including a cut the patient did not know about.
  • Treatment tray: antidote, sedative, charcoal, saline. Pick wrong and it gets worse.
  • Bad batch alerts carry the batch id, never the patient's name.
  • Rehab: 14 days at a clinic with check-ins, a substitute dose, meetings and a sponsor. Courts can order it.

Police, tests and trash

Police get what the trade leaves behind. Contraband training is taught in person at the academy and lapses.

A careful search: one look per item, a hunch with tells, asking for consent and the K9
  • Search: one roll per officer and item from training, seal, rattle and cover.
  • K9 ignores cover and reacts to the substance; a strong alert is a reason to open.
  • Tests: breathalyzer, a six-panel swab with faint lines at the edge, a blood draw with a lab report.
  • Evidence with batch, prints and the receipts that lead to the cook. A police terminal shows power meters and witness calls.
  • Trash: bins as dead drops, cleared after 24 hours, and a sanitation job that sometimes finds a heavy package.

Set it up

Compatibility

Every bridge is detected at start with one status line per sibling. np_npchandler and np_prophandler are required, both 1.1.0 or newer. Every other integration is optional and can be switched off.

KindSupported
Frameworkes_extended (first target), qbx_core, qb-core or standalone
Inventorynp_inventory, ox_inventory, qb-inventory or the ESX inventory (no batches without metadata)
JobsPolice, medic and sanitation from your framework jobs
Staffnp_admin permission nodes; without it framework groups, Config.Admins or np_discord roles. No ACE
Dispatchps-dispatch, cd_dispatch, qs-dispatch, core_dispatch, or a built-in toast and blip
MDTmd-stempeluhr over its HTTP API for the medical record
NP DEV resourceWhat np_drugs does with it
np_gangsAnswers np_drugs' hooks: corners, turf prices, gang stamps, lab permits
np_shopsThe pharmacy, hardware store and back room; receipts from every shop
np_inventoryMetadata, item actions, trunks, evidence lockers, searchable bins
np_phoneThe Vitals app
np_adminFive permission nodes, a Drugs settings page, staff tools and the audit log
np_prisonProducts are contraband; a drug test at intake

Installation

The tables are created on start. You build the NUI once and add the items for your inventory.

  1. Put the resource in resources/ as np_drugs.
  2. Build the NUI once (Node 18+):
    cd web && npm install && npm run build
  3. Items: np_inventory registers them on start. ox_inventory and qb-inventory: run npdrugs_items ox or qb and paste the output.
  4. Start it after its dependencies:
    ensure oxmysql
    ensure es_extended     # or qbx_core / qb-core (optional)
    ensure np_inventory    # or ox_inventory / qb-inventory
    ensure np_shops        # optional
    ensure np_npchandler   # required, 1.1.0+
    ensure np_prophandler  # required, 1.1.0+
    ensure np_drugs
    ensure np_gangs        # optional
  5. Map your police, medic and sanitation jobs in Config.Jobs, add an icon per item to your icon pack and move clinics, labs and the depot to your map.
  6. Optional: set np_drugs_mdt_url and np_drugs_mdt_key for the medical record in the MDT.

For your own scripts

Every sale, price, batch and body state is an export. Hooks let another resource set prices, take a share or add a row to a witness report.

-- what is this item, and what would it fetch here?
local info = exports.np_drugs:GetItemInfo(item)
local quote = exports.np_drugs:GetPrice(item, coords, src)

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

-- tax every sale in your territory
exports.np_drugs:registerHook('beforeSale', function(p)
  if inMyTerritory(p.coords) then return { payees = { { to = 'stash:territory', percent = 15 } } } end
end)

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

Questions

Is there a /drugs menu?

No. Everything is an item: a scale opens the batch table, a container hollows out, using a bag opens the method picker. There is no separate drug inventory.

Do I need np_gangs?

No. Without it np_drugs has personal stamps, a basic street sale to passers-by and labs wherever your config allows. With it, the corners replace the street sale.

Can players see what is inside a packed item?

Only the packer, on the item's card. Police find out by searching, with consent or a K9 alert. The contents never go into item metadata.

Does it work with the ESX inventory?

Yes, without batches: drug items are plain stacks of one grade. Selling, the body, tests, EMS, rehab and trash work.

Does it use ACE permissions?

No. Staff are np_admin permission nodes. Police, medics and sanitation workers come from your framework jobs.

Is it in German?

English and German, for the Lua messages and the NUI, set with Config.Locale.

Works well with

Build once, ensure it, press your first stamp.

Configuration, every export, hook and event are in the docs.

np_drugs docs