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:

  1. 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.
  2. 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.

FileMenu section it seeds
shared/config.luaGeneral
shared/config/equipment.luaEquipment & Stations
shared/config/items.luaRecipes
shared/config/stomp.luaStomping
shared/config/container.luaExtraction
shared/config/cook.luaCooking
shared/config/adulterants.luaAdulterants
shared/config/packaging.luaPackaging
shared/config/press.luaBrick Press
shared/config/wildplants.luaWild Plants
shared/config/progression.luaProgression
shared/config/usage.luaUsage & Effects

Core

General

SettingTypeDefaultWhat it does
Config.RequireOwnershipbooleantrueOnly the player who placed a station can pick it up. Set false to let anyone pack up anyone's equipment.
Config.SpawnDistancenumber100.0How close (in metres) a player must be before placed equipment appears for them.
Config.DefaultPuritynumber60The 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.ZoneModestring'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.SafeZonestable{} (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.AllowedZonestable{} (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.UsageWhitelisttable{} (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.Dispatchtableoff(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.Debugbooleanfalse(Advanced) Prints extra [oxide-cocaine] lines to the server console. Leave off unless you're troubleshooting.
Config.Animstablebase-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.

SettingDefaultWhat it does
Alert chance0Chance of an alert each time a stage is started. 0 turns alerts off completely. 0.15 means roughly one in seven.
Per-stage chanceall -1Set a different chance for one stage. -1 means "use the alert chance above".
Site cooldown300 sHow 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 jobspoliceWhich jobs receive the alert. Capitalisation doesn't matter.
Call code, Title, Message10-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.
Priority21 is highest.
Icon, Map blipThe 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.

SettingTypeDefault
Config.Equipment.kiddie_pool.itemstringkiddie_pool
Config.Equipment.coca_extractor.itemstringcoca_extractor
Config.Equipment.coke_table.itemstringcoke_table
Config.Equipment.brick_press.itemstringcoke_press
Config.Equipment.brick_press.requiredLevelnumber5

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.

StageInputOutput
Config.Items.stomp5 coca_leaf1 coca_mash
Config.Items.extract3 coca_mash + 1 kerosene1 coca_extract
Config.Items.cook.variants.cocaine2 coca_extract + 1 acetone1 cocaine
Config.Items.cook.variants.crack1 cocaine + 1-2 cuts1 or more crack (crack must be cut — see Adulterants)
Config.Items.package.variants.cocaine1 cocaine + 1 baggy1 cocaine_bag
Config.Items.package.variants.crack1 crack + 1 baggy1 crack_bag
Config.Items.press10 cocaine1 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:

SettingTypeDefaultWhat it does
Config.Items.cook.minTimenumber4Fewest seconds a cook can take to count as valid
Config.Items.package.minTimenumber3Fewest seconds a bagging session can take to count as valid
Config.Items.press.minTimenumber8Fewest 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).

SettingTypeDefaultWhat it does
radiusnumber0.65How close to the pool centre counts as "in the pool" (metres)
requiredDistancenumber35.0Total metres walked inside the pool to finish the stomp
minSpeednumber0.5Below this ped speed, movement doesn't count as stomping
mashThresholdnumber0.45Progress fraction at which the leaf pile swaps to the "mashed" look
pourControlnumber47The key to hold while pouring (47 = G)
cancelControlnumber73The key to cancel (73 = X)
abandonMsnumber15000Auto-cancel after this long continuously outside the pool (milliseconds)
minTimenumber8Server 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)

SettingTypeDefaultWhat it does
processTimenumber1800Seconds for a batch to soak (1800 = 30 minutes). Lower it for a faster chain.
loadTimenumber4000The pour-in progress bar when loading the extractor (milliseconds)
collectTimenumber2000The 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.

SettingTypeDefaultWhat it does
keynumber74Hold this key to show the labels (74 = H on foot)
maxDistnumber8.0Only show labels within this distance (metres)
heightOffsetnumber1.4How 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:

SettingTypeDefaultWhat it does
cookDurationnumber20000Length of the temperature phase (milliseconds)
cookStartTempnumber30.0Temperature when the cook starts (°C)
cookHeatRatenumber0.13How fast the temperature climbs on its own, per frame. Higher = harder cook.
cookCoolAmountnumber15.0How much pressing the correct key cools the pot (°C)
cookOverheatPenaltynumber3.0How much pressing a wrong key heats the pot (°C)
cookKeyChangeIntervalnumber4000How often the flashing key changes (milliseconds)
cookColdThresholdnumber15.0Below this temperature the batch starts going cold (°C)
cookColdMaxMsnumber5000How long the pot can stay that cold before the batch is ruined (milliseconds)
optimalTempMin / optimalTempMaxnumber35 / 65The temperature sweet spot that earns purity (°C)
cookKeystableE, Q, R, G, X, HThe pool of keys the minigame picks from (each needs a matching entry in cookKeyControls)
explodeOnOverheatbooleantrueWhether 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:

SettingWhat it does
labelThe name shown in the cut picker
modelThe prop tipped into the pot (and shown in the floating preview)
requiredLevelThe player level needed before this cut appears in the picker
purityBonusPoints added to the batch's purity score. Negative values lower the grade (most cuts), positive values raise it.
yieldBonusExtra crack units this cut adds to the batch

The eight cuts that ship, with their defaults:

Cut (item name)requiredLevelyieldBonuspurityBonus
baking_soda1+2-5
cornstarch1+2-15
baby_laxative1+2-10
creatine3+1-6
caffeine_powder3+1-8
benzocaine5+1-3
lidocaine5+10
levamisole7+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)

SettingTypeDefaultWhat it does
maxAdulterantsnumber2The most cuts a player can add to a single crack batch (the minimum is always 1 — crack must be cut)
previewOffsetvector3vec3(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.
previewSpinSpeednumber1.2How 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:

SettingTypeDefaultWhat it does
scoopsPerBagnumber3Bowl-to-baggy scoops needed to seal one bag
maxBagsPerSessionnumber10The most bags a single session can produce, regardless of how much bulk the player holds
dropSnapDistancenumber0.30How close the spoon must land to the bowl/baggy to count (metres)
cancelControlnumber177The 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.)

SettingTypeDefaultWhat it does
animDurationnumber9000How 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).

SettingTypeDefaultWhat it does
enabledbooleantrueTurn the whole wild-bush system on or off
spawnDistancenumber100.0How close a player must be before a bush appears (metres)
harvestTimenumber6000The harvest progress bar length (milliseconds)
harvestXPnumber10XP per harvest
yieldtable2-5 coca_leaf, 100% chanceHow many leaves a bush gives
respawnTimetable{ min = 1800, max = 3600 }Seconds before a harvested bush respawns (30-60 minutes)
zonestabletwo countryside zonesWhere 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)

ActionDefault 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, 11000

Purity 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, 0

If 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)

SettingTypeDefaultWhat it does
itemstringcocaine_bagThe usable item this profile applies to
cooldownnumber60Seconds to wait after the high ends before using again
stylestringsniffThe animation style (snorts a line)
effects.durationnumber90Effect length (seconds)
effects.intensitynumber0.5Visual strength (0-1)
effects.stressReliefnumber35Stress removed on use
effects.speedBoostnumber0.12Sprint speed bonus while high
effects.staminaRegennumber0.4Stamina restored per frame while high
effects.comedownStressnumber15Stress added back when the high ends

Crack (Config.Usage.products.crack)

SettingTypeDefaultWhat it does
itemstringcrack_bagThe usable item this profile applies to
cooldownnumber45Seconds to wait after the high ends before using again
stylestringsmokeThe animation style (smokes from a glass pipe)
effects.durationnumber50Effect length (seconds) — shorter than cocaine
effects.intensitynumber0.85Visual strength (0-1) — stronger than cocaine
effects.stressReliefnumber50Stress removed on use
effects.speedBoostnumber0.18Sprint speed bonus while high
effects.staminaRegennumber0.6Stamina restored per frame while high
effects.comedownStressnumber45Stress added back when the high ends — a much harsher crash

Effect toggles (Config.Usage.needsEffects)

Turn whole effect types on or off server-wide:

SettingTypeDefaultWhat it does
stressReliefbooleantrueRemove stress on use and add the comedown back at the end (needs a stress system — QBCore and QBX have one, ESX does not)
staminabooleantrueRegenerate stamina while high
speedbooleantrueApply 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:

GradeMultiplier
Pure1.3
High1.1
Mid1.0
Low0.8
Dirty0.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.).

Next Steps