> For the complete documentation index, see [llms.txt](https://documentation.rcore.cz/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://documentation.rcore.cz/paid-resources/rcore_drugs/configuration/config.md).

# Config

Edit `rcore_drugs/config.lua` for global settings that should apply to the whole script.

## 🛠️ Debug

Use debug only when testing or when support asks for more information.

```lua
Config.Debug = false
```

`Config.DebugLevel` controls which log levels are printed.

## 💬 Locale

Set the language file loaded from `rcore_drugs/locales`.

```lua
Config.Locale = 'en'
```

Only `en.lua` is included by default.

## 🔎 Auto Detection

These options are detected automatically by default:

| Option             | Default                 |
| ------------------ | ----------------------- |
| `Config.Framework` | `Framework.AUTO_DETECT` |
| `Config.Inventory` | `Inventory.AUTO_DETECT` |
| `Config.Database`  | `Database.AUTO_DETECT`  |
| `Config.Target`    | `Target.AUTO_DETECT`    |
| `Config.Gangs`     | `Gangs.AUTO_DETECT`     |
| `Config.Dispatch`  | `Dispatch.AUTO_DETECT`  |

Set them manually only if auto detection finds the wrong resource.

## 🚪 Lab Interaction

`Config.DrugLabEntryPoint` controls how players enter labs.

| Value              | Result                                       |
| ------------------ | -------------------------------------------- |
| `LAB_ENTRY.MARKER` | Players use marker interaction.              |
| `LAB_ENTRY.TARGET` | Players use your configured target resource. |

`Config.Markers` controls marker type, size, and color.

Default marker settings:

| Option  | Default                     |
| ------- | --------------------------- |
| `Type`  | `20`                        |
| `Size`  | `vector3(0.5, 0.5, 0.5)`    |
| `Color` | `vector4(255, 187, 0, 100)` |

## 🗺️ Blips

`Config.LabBlips` controls farm, meth lab, and cocaine lockup blips.

You can disable all lab blips:

```lua
Config.LabBlips.Enabled = false
```

## ⌨️ Commands

Change customer-facing commands in `Config.Commands`.

| Option           | Default           | Description                         |
| ---------------- | ----------------- | ----------------------------------- |
| `Admin`          | `drugs_admin`     | Opens the admin panel.              |
| `CheckAddiction` | `drugs_addiction` | Shows the player's addiction level. |

## 🛡️ Admin Groups

`Config.FrameworkAdminGroups` controls ESX and QBCore admin groups.

QBCore and QBX also use ACE permission checks for admin access.

## 🚚 Missions

`Config.Missions` controls drug sale missions.

| Option                        | Default | Description                                     |
| ----------------------------- | ------- | ----------------------------------------------- |
| `PaymentAccount`              | `money` | Account used for mission payouts.               |
| `ReturnUnsoldItemsToStash`    | `false` | Returns unsold items to lab stash when enabled. |
| `MaxDropOffLocations`         | `10`    | Maximum drop-off stops for a mission.           |
| `Purchasable.Enabled`         | `true`  | Controls paid mission unlocks.                  |
| `Purchasable.PurchaseAccount` | `money` | Account used when buying mission access.        |

## 🤝 Street Deals

`Config.StreetDeals` controls selling drugs to NPCs on the street.

Important settings:

| Option                | Default | Description                               |
| --------------------- | ------- | ----------------------------------------- |
| `Enabled`             | `true`  | Turns street deals on or off.             |
| `SaleMultiplier`      | `0.9`   | Multiplies the base sale price.           |
| `RandomRefusalChance` | `0.3`   | Chance that an NPC refuses the deal.      |
| `GiveWeaponToPed`     | `true`  | Allows attacking NPCs to receive weapons. |
| `SkillSystem.Enabled` | `true`  | Enables dealer progression.               |

## 🚨 Dispatch Alerts

`Config.DispatchAlerts.DrugUse` controls police alerts when players use drugs.

You can change:

* alert radius
* base chance by area type
* whether alerts are enabled

## 🧪 Addiction

`Config.AddictionSystem` controls drug addiction and withdrawal.

| Option                | Default | Description                                        |
| --------------------- | ------- | -------------------------------------------------- |
| `Enabled`             | `true`  | Turns addiction on or off.                         |
| `WithdrawalThreshold` | `20`    | Addiction level required before withdrawals start. |
| `WithdrawalTimeLimit` | `5000`  | Time before withdrawal effects begin.              |
| `DecayInterval`       | `30000` | How often addiction decays.                        |
| `DecayMin`            | `3`     | Minimum addiction decay per tick.                  |
| `DecayMax`            | `15`    | Maximum addiction decay per tick.                  |

## 🛒 Dealers and Shops

`Config.InstantSale` and `Config.Shops` control dealer ped models and instant sale timing.

Dealer locations, supplier items, and prices are configured in `/drugs_admin`.

## 📦 Special Props

`Config.SpecialProps` defines props that admins can place inside labs from the admin panel.

Add custom props here if they should appear as selectable lab props.

## 🌍 World Labs

`Config.WorldLab` controls activation range for world labs outside IPL interiors.

Use this if you create labs in normal world MLOs.

## 🔎 Configuration preview

<details>

<summary>config.lua</summary>

```lua
Config = {}

--[[

‼️ IMPORTANT TIP‼️

Use the /drugs_admin command to configure labs, drugs, locations and everything else

]]


-- Debug
-- Enable or disable debug mode, this will print debug messages to console
Config.Debug = false

Config.DebugLevel = {
    'INFO',
    'CRITICAL',
    'SUCCESS',
    'ERROR',
    'DEBUG',
}


-- Locale
-- Locale for translations (locales/[locale].lua)
Config.Locale = 'en'


-- [[[[[[     WARNING     ]]]]]]]
-- THIS configuration is automatic, you don't need to configure this at all. Change unless you really have to.
-- [[[[[[     WARNING     ]]]]]]]

-- Framework
-- Framework.AUTO_DETECT       = automatic detection
-- Framework.ESX               = es_extended
-- Framework.QBCore            = qb-core
-- Framework.QBX               = qbx_core
-- Framework.Standalone        = standalone
Config.Framework = Framework.AUTO_DETECT


-- Inventory systems
-- Inventory.AUTO_DETECT       = automatic detection
-- Inventory.OX                = ox_inventory
-- Inventory.QB                = qb-inventory
-- Inventory.QS                = qs-inventory
-- Inventory.MF                = mf-inventory
-- Inventory.PS                = ps-inventory
-- Inventory.LJ                = lj-inventory
-- Inventory.CORE              = core_inventory
-- Inventory.CHEZZA            = inventory
-- Inventory.CODEM             = codem-inventory
-- Inventory.ORIGEN            = origen_inventory
-- Inventory.TGIANN            = tgiann-inventory
-- Inventory.EXRP              = exrp_inventory
-- Inventory.NONE              = no inventory
Config.Inventory = Inventory.AUTO_DETECT


-- Database
-- Database.AUTO_DETECT        = automatic detection
-- Database.OX                 = oxmysql
-- Database.MYSQL_ASYNC        = mysql-async
-- Database.GHMATTI            = ghmattimysql
Config.Database = Database.AUTO_DETECT


-- Target systems
-- Target.AUTO_DETECT          = automatic detection
-- Target.OX                   = ox_target
-- Target.QB                   = qb-target
-- Target.Q                    = qtarget
-- Target.NONE                 = no target (marker/ped interaction)
Config.Target = Target.AUTO_DETECT


-- Gang systems
-- Gangs.AUTO_DETECT           = automatic detection
-- Gangs.QBCore                = qb-core
-- Gangs.RCORE                 = rcore_gangs
-- Gangs.NONE                  = no gangs
Config.Gangs = Gangs.AUTO_DETECT


-- Dispatch systems
-- Dispatch.AUTO_DETECT        = automatic detection
-- Dispatch.CODESIGN           = cd_dispatch
-- Dispatch.CODEM              = codem-dispatch
-- Dispatch.CORE               = core_dispatch
-- Dispatch.DUSA               = dusa_dispatch
-- Dispatch.EMERGENCY          = emergencydispatch
-- Dispatch.ORIGEN             = origen_police
-- Dispatch.QUASAR             = qs-dispatch
-- Dispatch.RCORE              = rcore_dispatch
-- Dispatch.TK                 = tk_dispatch
-- Dispatch.NONE               = no dispatch
Config.Dispatch = Dispatch.AUTO_DETECT


-- Lab entry point
-- LAB_ENTRY.MARKER            = marker
-- LAB_ENTRY.TARGET            = target system of your choice
Config.DrugLabEntryPoint = LAB_ENTRY.MARKER


-- Markers
-- https://docs.fivem.net/docs/game-references/markers/
Config.Markers = {
    Type = 20,
    Size = vector3(0.5, 0.5, 0.5),
    Color = vector4(255, 187, 0, 100),
}


-- Lab blips
-- Sprites: https://docs.fivem.net/docs/game-references/blips/
-- Colors: https://docs.fivem.net/docs/game-references/blips/#blip-colors
Config.LabBlips = {
    Enabled = true,

    farm = {
        Sprite = 496,
        Color = 25,
        Scale = 0.8,
        Label = 'Weed Farm',
        ShortRange = true,
    },
    lab = {
        Sprite = 499,
        Color = 5,
        Scale = 0.8,
        Label = 'Meth Lab',
        ShortRange = true,
    },
    lockup = {
        Sprite = 497,
        Color = 1,
        Scale = 0.8,
        Label = 'Cocaine Lockup',
        ShortRange = true,
    },
}

-- Harvest Area
Config.HarvestArea = {
    WaitTime = 1000,
}

-- Open menu key
Config.OpenMenuKey = 'E'


-- Action UI
-- bottom
-- top
Config.ActionUI = {
    Position = 'bottom',
}


-- Growing
Config.Growing = {
    Weed = {
        GrowthInterval = 5000, -- 5 seconds between growth ticks
    }
}


-- Dispatch alerts
Config.DispatchAlerts = {
    DrugUse = {
        Enabled = true,
        Radius = 30.0,
        ChanceByScumminess = {
            [0] = 70, -- Rich area: high chance
            [1] = 55,
            [2] = 40,
            [3] = 25,
            [4] = 10,
            [5] = 0, -- Poor area: nobody cares
        },
    }
}


-- Commands
Config.Commands = {
    Admin = "drugs_admin",
    CheckAddiction = "drugs_addiction"
}


-- Drug-specific configurations for location-based production
Config.DrugLocationSettings = {
    meth = {
        interactionKey = 'E',
        interactionDistance = 2.0,
        drugType = 'METH',
        labType = 'lab'
    },
    coke = {
        interactionKey = 'E',
        interactionDistance = 2.0,
        drugType = 'COKE',
        labType = 'lockup'
    },
    weed_processing = {
        interactionKey = 'E',
        interactionDistance = 2.5,
        drugType = 'WEED_PROCESSING',
        labType = 'weed_processing'
    }
}


-- Framework admin groups
Config.FrameworkAdminGroups = {
    [Framework.ESX] = { 'superadmin', 'admin' },
    [Framework.QBCore] = { 'god', 'admin' },
}


-- Routing buckets
Config.Bucket = {
    Default = 0,

    Min = 1000,
    Max = 5000,
}


-- Missions
Config.Missions = {
    PaymentAccount = 'money', -- ‼️ IMPORTANT ‼️ esx has money, qbcore has cash. bank is same on both frameworks

    -- If true, unsold items will be returned to the player's stash
    -- If false, they will be deleted
    ReturnUnsoldItemsToStash = false,

    Multipliers = {
        mobile_delivery = 1.0,
        plane_delivery = 1.5,
    },

    MaxDropOffLocations = 10,

    -- Purchasable missions
    Purchasable = {
        Enabled = true,
        PurchaseAccount = 'money', -- 'money' or 'bank' ‼️ IMPORTANT ‼️ esx has money, qbcore has cash

        Missions = {
            plane_delivery = {
                price = 25000,
            },
            mobile_delivery = {
                price = 15000,
            },
            boat_delivery = {
                price = 20000,
            },
            instant = {
                price = 10000,
            },
        }
    }
}


-- Street deals
Config.StreetDeals = {
    Enabled = true,
    SaleMultiplier = 0.9,
    RandomRefusalChance = 0.3,

    -- Each zone has a budget for deals. If player exceeds it, they will be refused automartically
    BudgetByScumminess = {
        [0] = { min = 500, max = 1500 }, -- richest
        [1] = { min = 400, max = 1200 },
        [2] = { min = 300, max = 800 },
        [3] = { min = 200, max = 600 },
        [4] = { min = 150, max = 400 },
        [5] = { min = 100, max = 300 }, -- poorest
    },

    -- Peds can have a chance to attack a player when they make a deal
    AttackChanceByScumminess = {
        [0] = 0.03, -- richest
        [1] = 0.05,
        [2] = 0.10,
        [3] = 0.15,
        [4] = 0.20,
        [5] = 0.25, -- poorest
    },

    -- Each zone can accept different types of drugs. For example, rich areas love coke but do not want meth
    DrugZoneAcceptance = {
        weed = { [0] = 0.15, [1] = 0.30, [2] = 0.60, [3] = 0.80, [4] = 0.95, [5] = 1.00 },
        meth = { [0] = 0.05, [1] = 0.15, [2] = 0.40, [3] = 0.70, [4] = 0.90, [5] = 1.00 },
        coke = { [0] = 1.00, [1] = 0.85, [2] = 0.60, [3] = 0.40, [4] = 0.20, [5] = 0.10 },
    },

    -- When player is attacked by the ped, can ped use a weapon?
    GiveWeaponToPed = true,
    WeaponTypes = {
        'WEAPON_KNIFE',
        'WEAPON_PISTOL',
        'WEAPON_COMBATPISTOL',
        'WEAPON_SWITCHBLADE',
    },

    -- Skill progression system
    SkillSystem = {
        Enabled = true,

        -- Tiers: Rookie → Apprentice → Dealer → Professional → Veteran → Kingpin
        Tiers = {
            { minDeals = 0,   maxDeals = 9,   name = "Rookie",       level = 0 },
            { minDeals = 10,  maxDeals = 24,  name = "Apprentice",   level = 1 },
            { minDeals = 25,  maxDeals = 49,  name = "Dealer",       level = 2 },
            { minDeals = 50,  maxDeals = 99,  name = "Professional", level = 3 },
            { minDeals = 100, maxDeals = 249, name = "Veteran",      level = 4 },
            { minDeals = 250, maxDeals = nil, name = "Kingpin",      level = 5 },
        },

        AttackReduction = {
            [0] = 0.00, -- Rookie
            [1] = 0.15,
            [2] = 0.30,
            [3] = 0.45,
            [4] = 0.60,
            [5] = 0.75, -- Kingpin
        },

        RefusalReduction = {
            [0] = 0.00, -- Rookie
            [1] = 0.10,
            [2] = 0.20,
            [3] = 0.35,
            [4] = 0.50,
            [5] = 0.70, -- Kingpin
        },

        PoliceDispatchReduction = {
            [0] = 0.00, -- Rookie
            [1] = 0.10,
            [2] = 0.25,
            [3] = 0.40,
            [4] = 0.60,
            [5] = 0.80, -- Kingpin
        },

        -- Chance a police will be called after te deal is done
        BasePoliceDispatchChance = 0.20,

        ShowLevelUpNotification = true,
    },
}


-- Lab robbery
-- When lab does not have security upgrade, there is a chance of theft or progress reset
Config.LabRobbery = {
    Enabled = true,
    Chance = 2, -- % chance of robbery
}


-- Addiction system
Config.AddictionSystem = {
    Enabled = true,
    WithdrawalThreshold = 20,   -- Level required before withdrawals can happen
    WithdrawalTimeLimit = 5000, -- ms before withdrawal starts (60000 * 5 = 5 minutes)
    DecayInterval = 30000,      -- How often addiction decays in ms
    DecayMin = 3,               -- Minimum addiction decay per tick
    DecayMax = 15,              -- Maximum addiction decay per tick
    DrugStrength = {
        weed = 10,
        meth = 25,
        coke = 15,
    }
}


-- Special props that can be added in labs using admins
Config.SpecialProps = {
    { model = 'bkr_prop_coke_press_01b', label = 'Brick Press' },
    { model = 'rds_barell_mixer',        label = 'Coke barell mixer' },
    { model = 'rds_meth_oven',           label = 'Coke oven' },
    { model = 'rds_meth_washer',         label = 'Coke washer' },
}


-- Instant sale
Config.InstantSale = {
    BaseCompletionTime = 10800000, -- 3 hours in milliseconds
    Multiplier = 0.8,              -- 80% of base price
    DealerModels = {
        'g_m_y_mexgang_01',
        'g_m_y_mexgoon_01',
        'g_m_y_mexgoon_02',
        'g_m_y_mexgoon_03',
        'g_m_y_lost_01',
        'g_m_y_lost_02',
        'g_m_y_lost_03',
    },
}


-- Shops
Config.Shops = {
    LabDealer = {
        DealerModels = {
            'g_m_y_mexgang_01',
            'g_m_y_mexgoon_01',
            'g_m_y_mexgoon_02',
            'g_m_y_mexgoon_03',
            'g_m_y_lost_01',
            'g_m_y_lost_02',
            'g_m_y_lost_03',
        },
    },
    Supplier = {
        DealerModels = {
            'g_m_y_mexgang_01',
            'g_m_y_mexgoon_01',
            'g_m_y_mexgoon_02',
            'g_m_y_mexgoon_03',
            'g_m_y_lost_01',
            'g_m_y_lost_02',
            'g_m_y_lost_03',
        },
    },
}

-- World lab - labs outside the IPL
Config.WorldLab = {
    ProximityRadius = 50.0,     -- meters, activation range
    ProximityHysteresis = 10.0, -- extra meters before deactivation
    PollInterval = 1000,        -- ms between proximity checks
}
```

</details>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://documentation.rcore.cz/paid-resources/rcore_drugs/configuration/config.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
