QBCore Frameworkqbcore.netCommunity docs
On this page

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:

KeyRole
Config.DebugDiagnostic output
Config.NearbyDeliveries / DeliveryWithinDelivery proximity limit
Config.DealersDealer names, hours, positions and product list
Config.UseTargetTarget interactions from UseTarget convar
Config.PoliceCallChanceNPC sale alert chance
Config.ProductsShop stock, item names, price and minimum reputation
Config.SuccessChance, ScamChance, RobberyChanceCorner sale outcomes
Config.MinimumDrugSalePoliceRequired active police
Config.DrugsPriceDrug sale pricing
Config.UseMarkedBillsCash/marked-bill payout mode
Config.DeliveryRepGain / DeliveryRepLossReputation changes
Config.DeliveryItems / DeliveryLocationsRequested items and routes
-- Modify these existing source keys:
Config.NearbyDeliveries = false
Config.DeliveryWithin = 2000
Config.PoliceCallChance = 99
Config.UseMarkedBills = false

No 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))
end

It 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

SymptomFirst check
Dealer list disappears on restartImported dealers SQL table and database
Selling at an NPC does not workCorrect drug items, police minimum and sale outcome configuration
Dealer shop emptyConfig.Products, item names and reputation requirements
Delivery never completesDeliveryLocations, inventory contents and server callback
No such export GetMarketPriceNot registered; only GetDealers is exported here

Update checklist

  1. Pin qb-drugs, qb-core, qb-inventory and SQL schema revisions.
  2. Preserve dealers and local configuration when updating.
  3. Test delivery/sale with valid and invalid items, amounts and permissions.
  4. 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.

On this page

Leonida RP server website built with RPWebsite
RPWebsite

Advertisement · RPWebsite

Want a website for your server?

Launch a site with live player status, rules, and a join button in minutes.

Build your website