coke processing
Requirements, install steps, items and first start for coke processing, a FiveM coke script with wild coca fields, coca growing, portable tables, purity and labs players buy.
coke processing (lation_coke) lets players search wild coca fields for leaves and seeds, grow their own coca plants, take cement from a construction site and cook it all into cocaine and crack, on portable tables or in labs they buy. Each player has their own amount of gasoline and cement to find, and it sets the purity of every brick and bag they make. Labs add stations that cook side by side, upgrades, a lock, a stash passcode and a camera, and police and rivals can break in. Everything is set in the files in config/, which ship open.
Works on Qbox, QBCore and ESX.
Requirements
| Resource | Needed | What for |
|---|---|---|
oxmysql | Required | Players, plants, tables and labs |
ox_lib | Required | Callbacks, zones and text, and the default menus, notifications, progress bars, dialogs and skill checks |
bob74_ipl | Required | The lab interior: every lab is the biker cocaine lockup |
qbx_core, qb-core, es_extended or ox_core | Required | Players, jobs, money and usable items |
| An inventory | Required | Item metadata: durability on watering cans, fertilizer, gasoline and cement, and purity on the product. ox_inventory, qb-inventory, qs-inventory, ps-inventory, origen_inventory, codem-inventory, core_inventory, tgiann-inventory or jaksam_inventory. |
ox_target, qb-target or interact | Required | Every prompt: the field, the cement, plants, tables, the two shops and the labs. Set yours in setup.interact. lation interact works too: it stands in for ox_target, so keep 'ox_target'. |
lation_ui | Optional | Notifications, menus, dialogs, progress bars, skill checks and the placement controls in the lation ui look. Each one stays on ox_lib until you set it to 'lation_ui'. |
| A dispatch script | Optional | Police alerts. ps-dispatch, cd_dispatch, qs-dispatch, redutzu-mdt, emergencydispatch, rcore_dispatch, codem-dispatch, tk_dispatch, core_dispatch, aty_dispatch or op-dispatch. |
okokNotify, sd-notify or wasabi_notify | Optional | Other notification systems |
fmsdk or fm-logs | Optional | Logging to Fivemanage or Fivemerr |
oxmysql, ox_lib and bob74_ipl are dependencies in fxmanifest.lua: coke processing doesn't start without them. The framework, the inventory and the dispatch script are found when it starts. The interaction system and each part of the interface are set in config/shared.lua.
Install
Follow the install guide, then:
Keep the folder name lation_coke. A renamed folder prints an error on start and again every 15 minutes, and the lab pictures in the lab dealer's menu load from nui://lation_coke/labs/.
Add the 18 items and their images to your inventory. The files ship in install/, and the image names match the item names.
Paste the contents of install/items/ox_inventory.txt into ox_inventory/data/items.lua, then copy every file in install/images/ into ox_inventory/web/images/. This is the one to use on Qbox.
Paste the contents of install/items/qb-inventory.txt into qb-core/shared/items.lua, then copy every file in install/images/ into qb-inventory/html/images/.
Paste the contents of install/items/qs-inventory.txt into the item list of qs-inventory, then copy every file in install/images/ into its image folder.
Add the same 18 items in your inventory's own format, with the labels and weights in items below, and copy every file in install/images/ into its image folder. Make the watering can, fertilizer, gasoline and cement unique (non-stacking): each one carries its own durability. The seed, the coke table and both bags are made usable through your framework, so nothing else is needed for them.
Set your interaction system and pick the interface in config/shared.lua. The defaults are ox_target and ox_lib:
setup = {
interact = 'ox_target', -- 'ox_target', 'qb-target', 'interact' or 'custom'
notify = 'ox_lib', -- or 'lation_ui', 'esx', 'qb', 'okok', 'sd-notify', 'wasabi_notify'
progress = 'ox_lib', -- or 'lation_ui', 'qbcore'
minigame = 'ox_lib', -- or 'lation_ui'
menu = 'ox_lib', -- or 'lation_ui'
dialogs = 'ox_lib', -- or 'lation_ui'
-- ...
},The placement controls (text UI) are picked in client/functions.lua; see text UI.
Ensure it after its dependencies, your framework, your inventory and your interaction system. If you run lation ui, it goes first, above ox_lib, because the lation ox_lib fork looks for it when ox_lib starts.
ensure lation_ui # optional
ensure oxmysql
ensure ox_lib
ensure bob74_ipl
ensure qbx_core # your framework
ensure ox_target # or lation_interact / qb-target / interact
ensure ox_inventory # your inventory
ensure lation_cokeRestart the server.
There is no SQL to import. On every start coke processing runs the .sql files in install/, which create its tables when they are missing, and adds any column a newer version needs.
Keep the install/ folder on the server. Without its .sql files the console prints "install folder or .sql files missing" every 10 seconds and nothing is saved.
| Table | Holds |
|---|---|
lation_coke_players | Each player's level, XP, lifetime stats, own gasoline and cement windows, and the lab they're inside |
lation_coke_plants | Every planted coca plant: where, its water, fertilizer, yield, growth and owner |
lation_coke_tables | Every placed table and the batch on it |
lation_coke_labs | Each owned lab: owner, upgrades, lock, passcode, authorized users, stations and last activity |
Items
| Item | Label | Weight | Usable |
|---|---|---|---|
ls_coke_table | Coke Table | 1000 | Yes, places a table |
ls_coca_seed | Coca Seed | 5 | Yes, plants a seed |
ls_coca_leaf | Coca Leaf | 5 | No |
ls_coca_ground | Ground Coca | 20 | No |
ls_coca_base_unf | Coca Base (unfinished) | 40 | No |
ls_coca_base | Coca Base | 50 | No |
ls_cocaine_brick | Cocaine Brick | 100 | No |
ls_crack_brick | Crack Brick | 100 | No |
ls_baking_soda | Baking Soda | 25 | No |
ls_gasoline | Gasoline | 1000 | No |
ls_shears | Shears | 10 | No |
ls_watering_can | Watering Can | 3250 | No |
ls_fertilizer | Fertilizer | 1750 | No |
ls_plant_pot | Plant Pot | 25 | No |
ls_cement | Cement | 2000 | No |
ls_empty_baggy | Empty Baggy | 5 | No |
ls_cocaine_bag | Cocaine | 10 | Yes, uses it |
ls_crack_bag | Crack | 10 | Yes, uses it |
The names must match, or be changed in config/shared.lua to match yours.
The watering can, fertilizer and gasoline from the farmer's shop, and the cement from a pallet, come with 100 durability, and every use takes some off. One given another way, such as spawned by an admin or sold by another shop, has no durability and can't be used. The coca bases, bricks and bags carry their purity.
First start
On the first start the tables are created and the server is playable straight away.
Go to the Farmer blip in Grapeseed (1901.11, 4924.45) and choose Talk to open Rusty's Shop. Buy shears, a plant pot, a watering can, fertilizer, gasoline, empty baggies and a coke table.
Go to the Coca Field blip (2139.13, 5169.00), target a coca plant and choose Search for leaves and, sometimes, a seed.
Take cement from the pallets at the construction site around -486.75, -1051.96 (no blip), then place the coke table and follow making coke.
The Lab Shop blip (-7.25, 409.28) is the lab dealer. See labs.
Commands
| Command | Who | What it does |
|---|---|---|
/resetbucket | Everyone | Puts you back in routing bucket 0, for a player left in a lab's bucket |
/getrot | Everyone, with setup.debug on | Copies your rotation to the clipboard, for a lab's camrot |
/getbucket | Everyone, with setup.debug on | Prints your routing bucket in the server console |
Troubleshooting
It says I do not have enough water or fertilizer, but I have the item
The watering can or fertilizer has no durability left, or never had any. Buy them from Rusty's Shop, which gives them 100. If you sell them in another shop, give them durability there: on ox_inventory, metadata = { durability = 100 }. The field is durabilityPercent on tgiann-inventory and quality on the other inventories.
Adding gasoline or cement says You do not have enough
The slider asked for more than the gasoline can or cement bag has left, or the item has no durability (see above). Gasoline comes from Rusty's Shop and cement from the pallets, both with 100.
A plant won't go down where I put it
The outline is red: the spot is inside an object, or on ground that isn't one of the soil types in planting.soil.types. Turn on setup.debug and F8 prints the ground's soil hash while you place; add it to the list, or add the area to planting.soil.ignore.
The console says to rename the folder
The resource folder isn't named lation_coke. Rename it back and restart; the message repeats every 15 minutes until you do.
The F8 console says No police dispatch detected
A dispatch roll hit and none of the supported dispatch scripts was running. Start one before lation_coke, or set the dispatch chances to 0 (see police alerts).
A player is stuck in an empty world
They are still in a lab's routing bucket. They can run /resetbucket to go back to bucket 0.
The console says Unable to fetch version information from API
The update check couldn't reach the version server. It changes nothing in game. Set setup.version to false to skip it.
Still stuck? Ask in our Discord: the people who write the scripts answer.
Last updated