Updated 2026-10-11 · 3 min read
qb-drugs: deliveries, dealer shops and NPC sales
The official qb-drugs implements NPC corner selling and delivery jobs with configurable dealers and payout conditions. This page follows upstream commit 51052d1. It does not implement the fictional drug labs, seizure registry or investigation database previously described here.
Installation and data storage
Start qb-core, oxmysql, PolyZone and inventory dependencies, then qb-drugs. The manifest loads distinct client/server files for deliveries and cornerselling. Ensure the shared item catalog contains every drug/product item you configure.
The packaged qb-drugs.sql creates a dealers table with dealer identity, coordinates, times and creator. There is no drug_labs or drug_seizures table in the upstream schema. Back up existing dealer data before migrating a fork.
Configuration
The top-level Config table includes:
| Key | Role |
|---|---|
Config.Debug | Diagnostic output |
Config.NearbyDeliveries / DeliveryWithin | Delivery proximity limit |
Config.Dealers | Dealer names, hours, positions and product list |
Config.UseTarget | Target interactions from UseTarget convar |
Config.PoliceCallChance | NPC sale alert chance |
Config.Products | Shop stock, item names, price and minimum reputation |
Config.SuccessChance, ScamChance, RobberyChance | Corner sale outcomes |
Config.MinimumDrugSalePolice | Required active police |
Config.DrugsPrice | Drug sale pricing |
Config.UseMarkedBills | Cash/marked-bill payout mode |
Config.DeliveryRepGain / DeliveryRepLoss | Reputation changes |
Config.DeliveryItems / DeliveryLocations | Requested items and routes |
-- Modify these existing source keys:
Config.NearbyDeliveries = false
Config.DeliveryWithin = 2000
Config.PoliceCallChance = 99
Config.UseMarkedBills = falseNo generic Config.Labs, Config.ProductionTime, Config.Investigation or Config.Penalties is present in the reviewed source.
Real external server export
The delivery server exposes GetDealers:
local dealers = exports['qb-drugs']:GetDealers()
-- Read only; avoid mutating the resource's shared dealer table.
for name in pairs(dealers or {}) do
print(('Configured dealer: %s'):format(name))
endIt does not export ProcessSeizure, GetMarketPrice or a generic production-lab API. Dealer management commands include newdealer, deletedealer, dealers and dealergoto; examine their QBCore permissions before allowing staff to use them.
Event and permission boundaries
The server uses qb-drugs:server:RequestConfig as a QBCore callback, plus updateDealerItems, giveDeliveryItems, successDelivery and dealerShop under the same server prefix. The corner-selling implementation registers qb-drugs:server:cornerselling:getAvailableDrugs, sellCornerDrugs, robCornerDrugs and giveStealItems.
These internal event paths can grant items or money. Treat client-supplied quantities, delivery state, sale totals and dealer coordinates as untrusted and validate against the server's own rules. Never expose arbitrary TriggerServerEvent examples that pay rewards.
Troubleshooting
| Symptom | First check |
|---|---|
| Dealer list disappears on restart | Imported dealers SQL table and database |
| Selling at an NPC does not work | Correct drug items, police minimum and sale outcome configuration |
| Dealer shop empty | Config.Products, item names and reputation requirements |
| Delivery never completes | DeliveryLocations, inventory contents and server callback |
No such export GetMarketPrice | Not registered; only GetDealers is exported here |
Update checklist
- Pin
qb-drugs,qb-core,qb-inventoryand SQL schema revisions. - Preserve
dealersand local configuration when updating. - Test delivery/sale with valid and invalid items, amounts and permissions.
- Audit server rewards and dealer access for forged or repeated events.
Sources
Repository · Configuration · Dealer SQL · Delivery code · Corner selling
Found an issue in this guide?
Send the page URL, the affected example, and a source or reproduction to the site maintainer. For a server or resource problem, use the support guide.
