Installation

Install oxide-cocaine, register its complete item chain, and verify the production flow.

Step-by-step setup for oxide-cocaine. Follow the steps in order — most issues come from skipping one.

Before You Start

oxide-cocaine works on QBCore, QBX, and ESX. It detects your framework automatically — there is nothing framework-specific to configure in the script itself. The only framework-side work is adding the items to your inventory (step 4).

You need these resources installed and working first:

ResourceWhat it does
ox_libProvides translations, callbacks, and UI helpers
oxmysqlConnects the server to your MySQL database
o-linkConnects cocaine to your framework (players, inventory, notifications, targeting, needs)

If you already run other Oxide resources, you have all three.

Installation Steps

1. Place the resource

Put the oxide-cocaine folder inside your server's resources folder.

2. Set the startup order

Your server.cfg is the text file that tells your server which resources to start, and in what order. Open it and make sure the dependencies start before cocaine:

ensure ox_lib
ensure oxmysql
ensure o-link
ensure oxide-cocaine

Your framework and inventory resources should already start before o-link — if other Oxide resources work on your server, this is already correct.

3. Database — nothing to do

The resource creates its own database tables the first time it starts, so there is no SQL script to run. (sql/install.sql is still included if you prefer to create the tables yourself or want to see the schema.)

These are the five tables it creates:

TableWhat it stores
drugs_progressionEach player's cocaine level, XP, and totals
drug_equipmentPools, extractors, tables, and presses players have placed in the world
cocaine_pool_stateWhich pools are holding finished mash, so nothing is lost on restart
cocaine_container_stateWhich extractors are mid-soak and when they started, so timers survive a restart
oxide_settingsThe live configuration you edit in-game with /cocaine settings (see Configuration)

It is safe to run oxide-cocaine alongside oxide-weed, oxide-meth, or any other Oxide resource — drugs_progression, drug_equipment, and oxide_settings are shared tables on purpose (each resource keeps its own rows), and each resource only creates them if they don't exist yet.

4. Add the items to your inventory

oxide-cocaine needs every item below to exist in your inventory with the exact spelling shown. A single typo in an item name will break that step of the production line.

Equipment

ItemSuggested LabelMust be usable
kiddie_poolCoca PoolYes
coca_extractorCoca ExtractorYes
coke_tableCook & Bag TableYes
coke_pressBrick PressYes
cocaine_manualCocaine ManualYes

Ingredients and reagents

ItemSuggested Label
coca_leafCoca Leaves
keroseneKerosene
acetoneAcetone
baking_sodaBaking Soda
baggyBaggy

baggy is the empty bag that bagging uses up — one baggy is consumed for every street bag a player seals. If you forget to register it, players won't be able to bag cocaine or crack: they'll get a "you don't have the required items" message at the table even with plenty of powder on hand.

Cutting agents (crack cuts)

These are the cutting agents a player adds when cooking crack to stretch the batch (see Features → Cutting Crack). Crack must be cut — a player needs at least one of these to make crack at all — so register them, or players won't be able to cook crack. Any cut that isn't registered simply never appears in the picker.

ItemSuggested Label
cornstarchCornstarch
baby_laxativeBaby Laxative
creatineCreatine
caffeine_powderCaffeine Powder
benzocaineBenzocaine
lidocaineLidocaine
levamisoleLevamisole

baking_soda (already listed above) is also one of the cuts. None of these need to be usable.

Production chain

ItemSuggested LabelMust be usable
coca_mashCoca MashNo
coca_extractCoca ExtractNo
cocaineCocaineNo
crackCrackNo
cocaine_bagBag of CocaineYes
crack_bagBag of CrackYes
cocaine_brickCocaine BrickNo

"Must be usable" means the player can right-click/use the item from their inventory. The script handles what happens when it's used — your inventory just needs to allow it. The four equipment items and the manual start placement or open the book when used. cocaine_bag and crack_bag are the finished street products players actually consume.

If you use ox_inventory (common on QBX and ESX), add the items to ox_inventory/data/items.lua. Every item is usable by default in ox_inventory, so a minimal entry is enough:

['kiddie_pool'] = { label = 'Coca Pool', weight = 7000 },
['coca_extractor'] = { label = 'Coca Extractor', weight = 5000 },
['coke_table'] = { label = 'Cook & Bag Table', weight = 7000 },
['coke_press'] = { label = 'Brick Press', weight = 8000 },
['cocaine_manual'] = { label = 'Cocaine Manual', weight = 100 },
['coca_leaf'] = { label = 'Coca Leaves', weight = 50 },
['kerosene'] = { label = 'Kerosene', weight = 500 },
['acetone'] = { label = 'Acetone', weight = 500 },
['baking_soda'] = { label = 'Baking Soda', weight = 300 },
['cornstarch'] = { label = 'Cornstarch', weight = 200 },
['baby_laxative'] = { label = 'Baby Laxative', weight = 200 },
['creatine'] = { label = 'Creatine', weight = 200 },
['caffeine_powder'] = { label = 'Caffeine Powder', weight = 200 },
['benzocaine'] = { label = 'Benzocaine', weight = 200 },
['lidocaine'] = { label = 'Lidocaine', weight = 300 },
['levamisole'] = { label = 'Levamisole', weight = 200 },
['baggy'] = { label = 'Baggy', weight = 5 },
['coca_mash'] = { label = 'Coca Mash', weight = 200 },
['coca_extract'] = { label = 'Coca Extract', weight = 150 },
['cocaine'] = { label = 'Cocaine', weight = 100 },
['crack'] = { label = 'Crack', weight = 100 },
['cocaine_bag'] = { label = 'Bag of Cocaine', weight = 50 },
['crack_bag'] = { label = 'Bag of Crack', weight = 50 },
['cocaine_brick'] = { label = 'Cocaine Brick', weight = 1000 },

If you use qb-inventory (default QBCore), add the items to qb-core/shared/items.lua. Set useable = true on the items marked "must be usable" above:

kiddie_pool = { name = 'kiddie_pool', label = 'Coca Pool', weight = 7000, type = 'item', image = 'kiddie_pool.png', unique = false, useable = true, shouldClose = true, description = 'A pool for stomping coca' },
coca_leaf = { name = 'coca_leaf', label = 'Coca Leaves', weight = 50, type = 'item', image = 'coca_leaf.png', unique = false, useable = false, shouldClose = true, description = 'Fresh coca leaves' },
cocaine = { name = 'cocaine', label = 'Cocaine', weight = 100, type = 'item', image = 'cocaine.png', unique = false, useable = false, shouldClose = true, description = 'Bulk powder cocaine' },
cocaine_bag = { name = 'cocaine_bag', label = 'Bag of Cocaine', weight = 50, type = 'item', image = 'cocaine_bag.png', unique = false, useable = true, shouldClose = true, description = 'A sealed street bag' },
-- ...repeat for every item in the tables above

Notes:

  • The values above (weight, descriptions) are suggestions — adjust them to taste. The names must match exactly.
  • Don't skip the chain items. If coca_mash doesn't exist, stomping the pool will fail, and so will every step after it.

5. Copy the item images

Copy all the .png files from items/ into your inventory's image folder:

  • qb-inventory: qb-inventory/html/images/
  • ox_inventory: ox_inventory/web/images/

The filenames already match the item names, so no renaming is needed.

6. Configure it (in-game)

The defaults work out of the box and are tuned for live play, so you can open to players right away and adjust later.

When you do want to change something, you do it in-game, not by editing files. As an admin, run /cocaine settings to open the settings menu — every setting is there (recipes, timers, XP and levels, purity, minigame difficulty, prop positions, effects, and the in-world zones), and changes apply live and save automatically. See Configuration for how this works and what every setting does.

Config files are factory defaults

The shared/config files are the resource's factory defaults — the values it starts from on first launch. After the first start, the database holds your settings and editing those files does nothing. Change settings with /cocaine settings instead.

Areas you might want to look at first, all editable in the menu:

  • General — ownership, default purity
  • Placement Zones — zone mode, blocked areas, allowed areas
  • Usage Whitelist — which jobs or gangs may use each item
  • Recipes — the item names and amounts each stage uses
  • Extraction — the soak extractor's process time (30 minutes by default)
  • Wild Plants — where wild coca bushes spawn
  • Progression — XP rewards and level thresholds
  • Usage & Effects — what happens when players use bagged cocaine or crack

Check That It Works

  1. Start the server and confirm ox_lib, oxmysql, o-link, and oxide-cocaine all start without errors in the console.
  2. Give yourself admin permission for the test commands (see Admin), then run /cocaine kit in game — you should receive a full set of equipment and ingredients.
  3. Use the Coca Pool item from your inventory and place it on the ground. Do the same with the extractor, table, and press.
  4. Walk up to the pool and stomp the leaves, then collect the mash from the pool.
  5. Load the mash and kerosene into the extractor, wait for the soak, then collect the extract. (The soak takes 30 minutes by default — to test the chain quickly, open /cocaine settingsProductionExtraction and drop the soak time to a few seconds, then set it back for live play.)
  6. At the table, start a cocaine cook — pour the reagents, ride the temperature minigame, and confirm you receive cocaine.
  7. Bag the cocaine at the table, then use the finished cocaine_bag and confirm the effects play.
  8. Run /cocaine stats and confirm your level and XP card appears.

If any step fails, see Troubleshooting.

Good To Know

  • Players learn the system in game. The cocaine_manual item opens a full illustrated guide covering harvesting, stomping, soaking, cooking, bagging, pressing, and leveling. Hand it out or sell it — players don't need out-of-game instructions.
  • Items keep their quality through the whole chain. The purity grade is stored on the item itself, so mash, extract, powder, bags, and bricks can be traded between players without losing anything.
  • This resource streams its own props. Everything — the kiddie pool, its leaf stages, and the cook table's stove — lives in stream/ and loads automatically. There is nothing to set up.
    • One note if you also run oxide-meth: both resources ship the same stove prop (prop_oxide_portable_stove), so on startup your server console will log a harmless duplicate archetype warning for it. The stove still loads and works normally — you can ignore the warning. If you'd rather silence it, open oxide-cocaine/fxmanifest.lua and comment out the line data_file 'DLC_ITYP_REQUEST' 'stream/prop_oxide_portable_stove.ytyp' by putting -- in front of it; oxide-meth's copy will load the prop for both resources. Restart afterwards.
  • The interface ships ready to use. There is nothing to build, compile, or install for it — it works as soon as the resource starts.
  • Translations: the on-screen notifications, prompts, and menu options live in locales/en.json and can be translated there.

Next Steps