Configuration
The database-backed settings model, the in-game settings menu, and every setting in oxide-cocaine with defaults.
oxide-cocaine is configured in-game, from a settings menu — you don't edit script files on a running server. This guide explains how that works, then lists every setting so you know what each one does.
How Configuration Is Stored
oxide-cocaine keeps its live configuration in your database, in a shared table called oxide_settings. The shared/config.lua file and the files in shared/config/ are the factory defaults — the starting values the resource ships with. The table is created automatically on first start (you don't run any SQL by hand).
The flow:
- The first time the resource starts, every value from the config files is copied into
oxide_settings. If you're upgrading and had customized those files, your customizations are copied in as-is — nothing is lost. - From then on, the database is what the resource reads. The config files were only the defaults it filled the table from that first time. Editing them on a server that has already started once will not change anything.
What this means for you:
- Setting up for the very first time? You can edit the config files before the first start, and your values will be imported. But the easier path is to start the resource with the defaults and adjust everything in-game.
- Changing a setting on a server that has already run the resource? Use the in-game settings menu (below). Editing the file does nothing at that point.
- A resource update adds new settings? Those aren't in your database yet, so they come from the updated config file automatically on the next start — no action needed.
The in-game settings menu
As an admin, run /cocaine settings in-game. This opens an editor for every setting. Changes apply live and are saved to the database immediately — no restart.
- Settings are grouped into a sidebar of four categories — Core, Production, World, and Players — holding 12 sections in total (listed below).
- Each section has a Basic tab (the common settings) and an Advanced tab (fine-tuning), plus a search box.
- Every field shows whether it's been changed, and has a Reset to default button that restores that setting's factory value (the value from the config files).
- The in-world zones (placement zones and wild-plant spawn zones) are drawn directly in the world: the menu hides, you place the polygon points, then the menu returns. Each zone also has a Teleport button.
- Model fields accept either a prop model name (like
prop_pot_03) or a hash number. Names are converted to a number when you save, so a model you typed by name will show as a number afterward — that's normal. - Item fields have a browse button that opens a searchable catalog of your framework's items, with icons, so you don't have to type item names by hand.
Most changes take effect the moment you save. A few need a brief rebuild that the resource does for you: changing station props or their positions respawns the placed stations for everyone within a few seconds, and changing wild-plant settings respawns the bushes.
Developers can also read and write settings from another resource — see Exports.
Setting names
The setting names below (like Config.RequireOwnership) are the names you'll see in the menu, without the Config. prefix. The tables list each setting's default so you know the starting point.
The Config Files (factory defaults)
These files hold the defaults imported into the database on first start. They're worth reading as a reference for what each setting means, but the settings menu is how you change a running server.
| File | Menu section it seeds |
|---|---|
shared/config.lua | General |
shared/config/equipment.lua | Equipment & Stations |
shared/config/items.lua | Recipes |
shared/config/stomp.lua | Stomping |
shared/config/container.lua | Extraction |
shared/config/cook.lua | Cooking |
shared/config/adulterants.lua | Adulterants |
shared/config/packaging.lua | Packaging |
shared/config/press.lua | Brick Press |
shared/config/wildplants.lua | Wild Plants |
shared/config/progression.lua | Progression |
shared/config/usage.lua | Usage & Effects |
Core
General
| Setting | Type | Default | What it does |
|---|---|---|---|
Config.RequireOwnership | boolean | true | Only the player who placed a station can pick it up. Set false to let anyone pack up anyone's equipment. |
Config.SpawnDistance | number | 100.0 | How close (in metres) a player must be before placed equipment appears for them. |
Config.DefaultPurity | number | 60 | The purity score (0-100) stamped on stages that don't run a scoring minigame — mash and extract. At 60 that's a Mid grade. |
Config.ZoneMode | string | 'blacklist' | How placement zones work: 'off' (place anywhere), 'blacklist' (blocked inside SafeZones), or 'whitelist' (blocked outside AllowedZones). Shown in the menu as Zone mode. |
Config.SafeZones | table | {} (empty) | Areas where equipment can't be placed (for example around hospitals or spawns), used in 'blacklist' mode. Shown in the menu as Blocked areas and drawn in the world with the zone tool. Ships empty. |
Config.AllowedZones | table | {} (empty) | The only areas where equipment may be placed, used in 'whitelist' mode. Shown as Allowed areas. Both lists are kept whichever mode is active. Leaving this empty while in 'whitelist' mode blocks placement everywhere. |
Config.UsageWhitelist | table | {} (empty) | Per-item usage rules: { item, jobs, gangs, minRank, dutyOnly }. Items with no rule stay usable by everyone. A rule passes if the job list matches or the gang list matches; empty lists allow any job/gang with rank and duty still checked. dutyOnly is ignored on the gang side. |
Config.Dispatch | table | off | (Advanced) Police alerts raised when a player starts a production stage. Ships with an alert chance of 0, so it does nothing until you turn it on. See Police Alerts. |
Config.Debug | boolean | false | (Advanced) Prints extra [oxide-cocaine] lines to the server console. Leave off unless you're troubleshooting. |
Config.Anims | table | base-game clips | (Advanced) The animations used when placing or packing up equipment, loading the extractor, and collecting the extract. You normally won't need to touch these. |
Police Alerts
Production is risk-free out of the box. To make it occasionally draw police, open the Dispatch section (under Core, on the Advanced tab).
When a player starts a stage the server rolls once. On a hit, a dispatch call goes out at the station's location — not the player's, so a suspect can't fake or move it.
| Setting | Default | What it does |
|---|---|---|
| Alert chance | 0 | Chance of an alert each time a stage is started. 0 turns alerts off completely. 0.15 means roughly one in seven. |
| Per-stage chance | all -1 | Set a different chance for one stage. -1 means "use the alert chance above". |
| Site cooldown | 300 s | How long before that same station can raise another alert. Other stations are unaffected, so a player can't be alerted on repeatedly at one lab. |
| Alert jobs | police | Which jobs receive the alert. Capitalisation doesn't matter. |
| Call code, Title, Message | 10-15, "Suspected Narcotics Lab", … | The text responders see. The default message deliberately doesn't say what's being made — police get a location and a reason to look, not a confession. |
| Priority | 2 | 1 is highest. |
| Icon, Map blip | The Font Awesome icon and the blip drawn on the map. Search radius is the size of the circle around the site, so responders get an area to search rather than an exact door. |
The four stages you can tune separately are Stomp, Cook, Press and Package. A common setup is to leave the master chance low and raise just the cook, since that's the loudest part of the operation.
What "chance" means in practice. It's rolled per stage started, not per batch finished. A player who starts, cancels, and restarts rolls twice — but the site cooldown means only the first can actually alert.
What you need installed
Alerts go through whatever dispatch resource you run. Most are supported, including ps-dispatch, qs_dispatch, cd_dispatch, lb-tablet and the common MDTs. You don't strictly need one — with no dispatch resource installed, players with the alert job get a notification and a map blip instead.
If nobody with the alert job is online, the alert is discarded. That's intentional: there is no queue of stale calls waiting for the first officer to log in.
ESX and duty
On ESX, every player with the job receives the alert whether or not they're clocked on — ESX has no on-duty concept for this.
Equipment & Stations
The four placeable stations (Config.Equipment). Each entry sets the inventory item that places the station, the props that appear when placed, its offsets, and any level requirement.
| Setting | Type | Default |
|---|---|---|
Config.Equipment.kiddie_pool.item | string | kiddie_pool |
Config.Equipment.coca_extractor.item | string | coca_extractor |
Config.Equipment.coke_table.item | string | coke_table |
Config.Equipment.brick_press.item | string | coke_press |
Config.Equipment.brick_press.requiredLevel | number | 5 |
requiredLevel is the cocaine level needed to place that station. Only the brick press has one by default (level 5); the other three have none. The pool uses a sphere zone for its walk-up menu (because you stand inside it), tuned by its targetRadius (1.6). Each station's objects list holds its props — you can add, remove, or nudge props (model, offset, rotation) right in the menu.
Production
Recipes
The item names and amounts each stage consumes and produces (Config.Items). If you rename an item here, remember to register the new name in your inventory too.
| Stage | Input | Output |
|---|---|---|
Config.Items.stomp | 5 coca_leaf | 1 coca_mash |
Config.Items.extract | 3 coca_mash + 1 kerosene | 1 coca_extract |
Config.Items.cook.variants.cocaine | 2 coca_extract + 1 acetone | 1 cocaine |
Config.Items.cook.variants.crack | 1 cocaine + 1-2 cuts | 1 or more crack (crack must be cut — see Adulterants) |
Config.Items.package.variants.cocaine | 1 cocaine + 1 baggy | 1 cocaine_bag |
Config.Items.package.variants.crack | 1 crack + 1 baggy | 1 crack_bag |
Config.Items.press | 10 cocaine | 1 cocaine_brick |
Bagging also consumes one empty bag per sealed bag. Which item that is comes from Config.Items.package.bagItem (default baggy). Whatever you set must be registered in your inventory.
Each stage also has a "server floor" (minTime) — an anti-cheat guard. The server rejects a stage that completes faster than its floor:
| Setting | Type | Default | What it does |
|---|---|---|---|
Config.Items.cook.minTime | number | 4 | Fewest seconds a cook can take to count as valid |
Config.Items.package.minTime | number | 3 | Fewest seconds a bagging session can take to count as valid |
Config.Items.press.minTime | number | 8 | Fewest seconds a press can take to count as valid |
(The stomp has its own floor, Config.Stomp.minTime, listed under Stomping.)
You can change any input/output amount here. For example, raising Config.Items.press.inputCost makes bricks cost more cocaine.
Stomping
The pool stomp minigame (Config.Stomp).
| Setting | Type | Default | What it does |
|---|---|---|---|
radius | number | 0.65 | How close to the pool centre counts as "in the pool" (metres) |
requiredDistance | number | 35.0 | Total metres walked inside the pool to finish the stomp |
minSpeed | number | 0.5 | Below this ped speed, movement doesn't count as stomping |
mashThreshold | number | 0.45 | Progress fraction at which the leaf pile swaps to the "mashed" look |
pourControl | number | 47 | The key to hold while pouring (47 = G) |
cancelControl | number | 73 | The key to cancel (73 = X) |
abandonMs | number | 15000 | Auto-cancel after this long continuously outside the pool (milliseconds) |
minTime | number | 8 | Server floor: fewest seconds a stomp can take to count as valid (anti-cheat) |
The two additives poured before stomping (Alkali, then Water) are the additives list — each has a label and a pourTime (both 3000 ms by default). The models, pourProp, and per-additive particle blocks control how the props and streams look.
Extraction
The soak extractor (Config.Container)
| Setting | Type | Default | What it does |
|---|---|---|---|
processTime | number | 1800 | Seconds for a batch to soak (1800 = 30 minutes). Lower it for a faster chain. |
loadTime | number | 4000 | The pour-in progress bar when loading the extractor (milliseconds) |
collectTime | number | 2000 | The progress bar when collecting the extract (milliseconds) |
Tuning the soak
The soak runs 30 minutes by default, which makes the extractor a "load it and come back later" station. While you're testing the chain you may want to drop processTime to a few seconds so you don't have to wait it out — just set it back for live play.
World status labels (Config.Labels) (Advanced)
The styled panels that show over nearby extractors when the player holds the label key.
| Setting | Type | Default | What it does |
|---|---|---|---|
key | number | 74 | Hold this key to show the labels (74 = H on foot) |
maxDist | number | 8.0 | Only show labels within this distance (metres) |
heightOffset | number | 1.4 | How far above the station the label floats (metres) |
The remaining label settings (scaleNearDist, scaleFarDist, scaleMin, scaleMax, updateInterval) only affect how the labels scale and refresh, and rarely need changing.
Cooking
The stove cook minigame (Config.Cook). The interesting numbers for game balance:
| Setting | Type | Default | What it does |
|---|---|---|---|
cookDuration | number | 20000 | Length of the temperature phase (milliseconds) |
cookStartTemp | number | 30.0 | Temperature when the cook starts (°C) |
cookHeatRate | number | 0.13 | How fast the temperature climbs on its own, per frame. Higher = harder cook. |
cookCoolAmount | number | 15.0 | How much pressing the correct key cools the pot (°C) |
cookOverheatPenalty | number | 3.0 | How much pressing a wrong key heats the pot (°C) |
cookKeyChangeInterval | number | 4000 | How often the flashing key changes (milliseconds) |
cookColdThreshold | number | 15.0 | Below this temperature the batch starts going cold (°C) |
cookColdMaxMs | number | 5000 | How long the pot can stay that cold before the batch is ruined (milliseconds) |
optimalTempMin / optimalTempMax | number | 35 / 65 | The temperature sweet spot that earns purity (°C) |
cookKeys | table | E, Q, R, G, X, H | The pool of keys the minigame picks from (each needs a matching entry in cookKeyControls) |
explodeOnOverheat | boolean | true | Whether hitting 100°C triggers a real explosion at the table |
The temperature ceiling that ruins the batch (100°C) is fixed in code. The rest of Config.Cook (camera framing, pour steps, pot prop, fire/smoke effects) controls how the cooking scene looks and rarely needs changing — though every part of it is editable in the menu, including the base "cocaine base" prop (baseProp), which is optional and simply skipped if its model isn't streamed on your server.
Adulterants
The cutting agents ("cuts") a player adds when cooking crack, and how they change the result. A crack cook must include at least one cut (and takes up to Config.Cut.maxAdulterants), so a player with no cutting agents can't make crack.
The cuts (Config.Adulterants)
Each entry is one cutting agent, keyed by its item name. The numbers that matter:
| Setting | What it does |
|---|---|
label | The name shown in the cut picker |
model | The prop tipped into the pot (and shown in the floating preview) |
requiredLevel | The player level needed before this cut appears in the picker |
purityBonus | Points added to the batch's purity score. Negative values lower the grade (most cuts), positive values raise it. |
yieldBonus | Extra crack units this cut adds to the batch |
The eight cuts that ship, with their defaults:
| Cut (item name) | requiredLevel | yieldBonus | purityBonus |
|---|---|---|---|
baking_soda | 1 | +2 | -5 |
cornstarch | 1 | +2 | -15 |
baby_laxative | 1 | +2 | -10 |
creatine | 3 | +1 | -6 |
caffeine_powder | 3 | +1 | -8 |
benzocaine | 5 | +1 | -3 |
lidocaine | 5 | +1 | 0 |
levamisole | 7 | +1 | +2 |
Add, remove, or retune cuts freely in the menu. Each cut is also a real inventory item the player must hold and that gets used up when the batch finishes — these aren't sold anywhere by default, so decide how players source them. The remaining per-cut settings (offset, rotation, fx*, heatRateModifier, optimalRangeModifier) control how the pour looks and plays.
Cut rules (Config.Cut)
| Setting | Type | Default | What it does |
|---|---|---|---|
maxAdulterants | number | 2 | The most cuts a player can add to a single crack batch (the minimum is always 1 — crack must be cut) |
previewOffset | vector3 | vec3(0.0320, -0.1460, 1.5) | Where the floating preview prop sits above the stove when a cut is selected. Raise the last number to float it higher. |
previewSpinSpeed | number | 1.2 | How fast the preview prop slowly spins, in degrees per frame. Set to 0 to keep it still. |
Packaging
The bagging minigame (Config.Packaging). The loop tuning:
| Setting | Type | Default | What it does |
|---|---|---|---|
scoopsPerBag | number | 3 | Bowl-to-baggy scoops needed to seal one bag |
maxBagsPerSession | number | 10 | The most bags a single session can produce, regardless of how much bulk the player holds |
dropSnapDistance | number | 0.30 | How close the spoon must land to the bowl/baggy to count (metres) |
cancelControl | number | 177 | The key to finish early, banking completed bags (177 = Backspace) |
The remaining settings (camera, prop models, spoon movement, drag feel) control how the scene looks.
Brick Press
The brick press (Config.Press). (This whole section is under the Advanced tab.)
| Setting | Type | Default | What it does |
|---|---|---|---|
animDuration | number | 9000 | How long the press animation plays (milliseconds) |
The rest (mold props, animation clips, where the operator stands) controls how the press looks.
World
Wild Plants
Wild coca bushes that spawn in polygon zones around the map (Config.WildPlants).
| Setting | Type | Default | What it does |
|---|---|---|---|
enabled | boolean | true | Turn the whole wild-bush system on or off |
spawnDistance | number | 100.0 | How close a player must be before a bush appears (metres) |
harvestTime | number | 6000 | The harvest progress bar length (milliseconds) |
harvestXP | number | 10 | XP per harvest |
yield | table | 2-5 coca_leaf, 100% chance | How many leaves a bush gives |
respawnTime | table | { min = 1800, max = 3600 } | Seconds before a harvested bush respawns (30-60 minutes) |
zones | table | two countryside zones | Where bushes spawn — shown as Spawn zones and drawn in the world with the zone tool |
Each zone has a name, its polygon shape (drawn in-world), a minZ/maxZ height band, and an optional plants count for how many bushes it holds (defaults to 5 if left off). Add zones with the zone tool in the menu.
Players
Progression
XP rewards (Config.Progression.xpRewards)
| Action | Default XP |
|---|---|
stomp (collect mash) | 10 |
extract (collect extract) | 15 |
cook (finish a cook) | 25 |
package (per sealed bag) | 8 |
press (per brick) | 30 |
Wild bush harvest XP is set separately, under Wild Plants (harvestXP, default 10).
Levels (Config.Progression.levels)
Ten levels with these total-XP thresholds:
0, 100, 300, 650, 1200, 2000, 3200, 5000, 7500, 11000Purity penalties (Config.Progression.purityPenalties)
How many points each level loses off every cook's purity score (skilled cooks lose less):
-30, -25, -20, -15, -10, -8, -5, -3, -1, 0If you add a level, add a matching purity-penalty entry for it.
Usage & Effects
What happens when a player uses a bagged cocaine or crack item. Each product is defined under Config.Usage.products.
Cocaine (Config.Usage.products.cocaine)
| Setting | Type | Default | What it does |
|---|---|---|---|
item | string | cocaine_bag | The usable item this profile applies to |
cooldown | number | 60 | Seconds to wait after the high ends before using again |
style | string | sniff | The animation style (snorts a line) |
effects.duration | number | 90 | Effect length (seconds) |
effects.intensity | number | 0.5 | Visual strength (0-1) |
effects.stressRelief | number | 35 | Stress removed on use |
effects.speedBoost | number | 0.12 | Sprint speed bonus while high |
effects.staminaRegen | number | 0.4 | Stamina restored per frame while high |
effects.comedownStress | number | 15 | Stress added back when the high ends |
Crack (Config.Usage.products.crack)
| Setting | Type | Default | What it does |
|---|---|---|---|
item | string | crack_bag | The usable item this profile applies to |
cooldown | number | 45 | Seconds to wait after the high ends before using again |
style | string | smoke | The animation style (smokes from a glass pipe) |
effects.duration | number | 50 | Effect length (seconds) — shorter than cocaine |
effects.intensity | number | 0.85 | Visual strength (0-1) — stronger than cocaine |
effects.stressRelief | number | 50 | Stress removed on use |
effects.speedBoost | number | 0.18 | Sprint speed bonus while high |
effects.staminaRegen | number | 0.6 | Stamina restored per frame while high |
effects.comedownStress | number | 45 | Stress added back when the high ends — a much harsher crash |
Effect toggles (Config.Usage.needsEffects)
Turn whole effect types on or off server-wide:
| Setting | Type | Default | What it does |
|---|---|---|---|
stressRelief | boolean | true | Remove stress on use and add the comedown back at the end (needs a stress system — QBCore and QBX have one, ESX does not) |
stamina | boolean | true | Regenerate stamina while high |
speed | boolean | true | Apply the sprint speed boost while high |
Purity multipliers (Config.Usage.purityMultipliers)
The grade on the bag scales the high's duration, intensity, and stress relief:
| Grade | Multiplier |
|---|---|
| Pure | 1.3 |
| High | 1.1 |
| Mid | 1.0 |
| Low | 0.8 |
| Dirty | 0.6 |
The screen-effect block (Config.Usage.screenEffects) sets the timecycle filter, camera shake, FOV boost, and intensity-pulse timing. The defaults are tuned for a stimulant feel and rarely need changing. The styles block sets the sniff/smoke animations and the held props (glass pipe, etc.).