Blog
Tutorial
7 min read
April 18, 2026

FiveM Drug System Setup: ESX & QBCore Guide

Install and configure a grow/process/sell drug system on both ESX and QBCore. Covers dependencies, database setup, config walkthrough and economy tuning.

A drug system adds a persistent illegal economy to your server — growing, processing and selling mechanics that drive player activity in off-peak hours when legal jobs thin out. This guide covers the full installation and configuration on both ESX and QBCore, including the economy tuning that prevents inflation.

Dependencies by Framework

ESX servers

  • es_extended (Legacy 1.9+)
  • oxmysql
  • ox_lib
  • ox_inventory or esx_inventoryhud
  • ox_target (recommended) or any 3D interaction resource

QBCore servers

  • qb-core (latest stable)
  • oxmysql
  • ox_lib
  • qb-inventory or ox_inventory
  • qb-target or ox_target

Installation

  1. Place the resource folder in resources/[standalone]/ or resources/[jobs]/.
  2. Add ensure drug-system to server.cfg after ox_lib and your inventory resource.
  3. Import the database schema:
    mysql -u root -p your_db < drug-system.sql
  4. Set Config.Framework to either 'esx' or 'qbcore' in config.lua.
  5. Full server restart.

Database Tables Created

The drug system creates three core tables on first run:

drug_plants      -- active grow operations (owner, coords, strain, progress %)
drug_stashes     -- processing station inventories
drug_prices      -- dynamic NPC prices per drug (updated on each sale)

The drug_prices table powers the dynamic pricing system. Prices drop when supply is high and recover over a configurable cooldown period — this is what creates actual supply-and-demand tension rather than a static payout.

Configuration Walkthrough

The drug config is the most important tuning surface on your server. Every drug is defined in the same structure:

Config.Drugs = {
    weed = {
        seed        = 'weed_seed',     -- item name in your inventory
        raw         = 'weed_bud',
        processed   = 'weed_baggie',
        growTime    = 900,             -- seconds per growth stage
        processTime = 60,
        basePrice   = 45,              -- NPC sell price per unit at baseline
        policeAlert = 0.12,            -- 12% alert chance per sale
        maxPlants   = 6,               -- per player
    },
    -- cocaine, meth follow the same structure
}

Economy Tuning

The most common mistake when configuring a drug system is settingbasePricetoo high relative to legal job wages. If a dedicated drug runner earns more than 3× the hourly legal wage, money accumulates faster than it can be spent and your economy inflates within two weeks.

A sustainable starting point: drug income should be 1.5–2× the hourly legal wage, not 5–10×. Read the full breakdown in the FiveM economy balancing guide before setting final prices.

Set policeAlert between 0.08 and 0.15 (8–15%). Below 8% and there is no meaningful police interaction; above 20% and the job becomes frustrating rather than tense.

Testing the Full Loop

Test the complete grow → process → sell loop before going live. Plant a seed at a grow location, wait for the first growth stage (reducegrowTime to 30 seconds in dev), process the raw output, then sell to an NPC. Verify:

  • Inventory items deduct and add correctly at each stage
  • Database records update in drug_plants as growth progresses
  • Police alert fires at approximately the configured probability
  • NPC price reflects the current drug_prices table value

FAQ

What is the main point of FiveM Drug System Setup: ESX & QBCore Guide?

Install and configure a grow/process/sell drug system on both ESX and QBCore. Covers dependencies, database setup, config walkthrough and economy tuning.

Is this guide updated for FiveM in 2026?

Yes. The article is written for current FiveM server owners in 2026, with recommendations focused on txAdmin, modern frameworks, resource performance, database reliability, and stable RP server operation.

Does this apply to ESX, QBCore, and Qbox servers?

Most guidance applies to modern FiveM servers using ESX, QBCore, or Qbox. When a recommendation is framework-specific, the article calls that out directly.

What should I do after reading this guide?

After reading, test the setup on a staging server first. If you want a ready-made option, compare it against Drug System — Grow, Process & Sell and make sure it fits your framework, database, and performance requirements.

§
FIVE // MOTIVE
Tutorial · 7 min read · Published April 18, 2026
Featured in this guide
Drug System — Grow, Process & Sell

Complete FiveM drug script with growing, processing and selling mechanics. ESX and QBCore compatible.