Overview
- Sieve, press and table placeable by players, saved in the database.
- Four strains: OG Kush, Purple Haze, White Widow, Blue Dream.
- An NPC vendor for the equipment.
- No framework required: works on ESX, QBCore, Qbox or without a framework.
- Compatible with kq_weed, without depending on it.
- French and English included.
Presentation video, from buying the equipment to bagging: watch YF-Kush on YouTube.
Requirements
| Resource | Role |
|---|---|
ox_lib | Menus, inputs, notifications, client-server calls. |
ox_inventory | All items, the vendor's money and the images. |
ox_target | Interactions with the stations and the vendor. |
oxmysql | Saves the placed sieves, presses and tables. |
The sieve animation comes from The Contract DLC. Set sv_enforceGameBuild 2545 or higher in your server.cfg, otherwise the player sieves without an animation.
OneSync must be enabled, as on almost every current server: the server checks the players' distance before every action.
Installation
Six steps, in this order.
Add the resource
Get YF-Kush from the Cfx.re portal (see Getting your purchases). Copy the
yf-kushfolder into your resources, without renaming it: the protected version is tied to that name. Then add it to yourserver.cfg, after its dependencies.server.cfgensure ox_lib ensure oxmysql ensure ox_inventory ensure ox_target ensure yf-kushCreate the SQL tables
Run
install.sqlon your database. It createsyf_kush_tamis,yf_kush_pressesandyf_kush_tables. It is safe to run again.Declare the items
Add the block from the Items section at the end of
ox_inventory/data/items.lua, before the last closing brace.Copy the images
Copy the 25
yf_*.pngimages from theinstall/imagesfolder intoox_inventory/web/images.Adjust the config
Open
shared/config.lua: language, accepted buds, baggie, kq_weed tables and vendor. Details in Configuration.Restart the server
A full restart is needed the first time, to load the new ox_inventory items. The console shows how many sieves, presses and tables were loaded.
Items
25 items: the equipment, the buds provided by the script, then the four steps of the chain for each strain. The block below uses English labels; the French labels are in the French documentation.
-- yf-kush
['yf_tamis'] = {
label = "Pollen Sieve",
weight = 8000,
stack = true,
close = true,
consume = 0,
client = {
export = 'yf-kush.useTamis'
},
},
['yf_baguettes'] = {
label = "Beating Sticks",
weight = 500,
stack = true,
close = true,
consume = 0,
},
['yf_presse'] = {
label = "Pollen Press",
weight = 10000,
stack = true,
close = true,
consume = 0,
client = {
export = 'yf-kush.usePresse'
},
},
['yf_table'] = {
label = "Cutting Table",
weight = 15000,
stack = true,
close = true,
consume = 0,
client = {
export = 'yf-kush.useTable'
},
},
['yf_sachet_vide'] = {
label = "Empty Baggie",
weight = 1,
stack = true,
consume = 0,
},
['yf_tete_og_kush'] = {
label = "OG Kush Bud",
weight = 2,
stack = true,
consume = 0,
},
['yf_tete_purple_haze'] = {
label = "Purple Haze Bud",
weight = 2,
stack = true,
consume = 0,
},
['yf_tete_white_widow'] = {
label = "White Widow Bud",
weight = 2,
stack = true,
consume = 0,
},
['yf_tete_blue_dream'] = {
label = "Blue Dream Bud",
weight = 2,
stack = true,
consume = 0,
},
['yf_pollen_og_kush'] = {
label = "Pollen [OG Kush]",
weight = 50,
stack = true,
consume = 0,
},
['yf_pollen_purple_haze'] = {
label = "Pollen [Purple Haze]",
weight = 50,
stack = true,
consume = 0,
},
['yf_pollen_white_widow'] = {
label = "Pollen [White Widow]",
weight = 50,
stack = true,
consume = 0,
},
['yf_pollen_blue_dream'] = {
label = "Pollen [Blue Dream]",
weight = 50,
stack = true,
consume = 0,
},
['yf_plaque_og_kush'] = {
label = "Hash Slab [OG Kush]",
weight = 100,
stack = true,
consume = 0,
},
['yf_plaque_purple_haze'] = {
label = "Hash Slab [Purple Haze]",
weight = 100,
stack = true,
consume = 0,
},
['yf_plaque_white_widow'] = {
label = "Hash Slab [White Widow]",
weight = 100,
stack = true,
consume = 0,
},
['yf_plaque_blue_dream'] = {
label = "Hash Slab [Blue Dream]",
weight = 100,
stack = true,
consume = 0,
},
['yf_barrette_og_kush'] = {
label = "Hash Bar [OG Kush]",
weight = 10,
stack = true,
consume = 0,
},
['yf_barrette_purple_haze'] = {
label = "Hash Bar [Purple Haze]",
weight = 10,
stack = true,
consume = 0,
},
['yf_barrette_white_widow'] = {
label = "Hash Bar [White Widow]",
weight = 10,
stack = true,
consume = 0,
},
['yf_barrette_blue_dream'] = {
label = "Hash Bar [Blue Dream]",
weight = 10,
stack = true,
consume = 0,
},
['yf_pochon_og_kush'] = {
label = "Bag of Hash [OG Kush]",
weight = 11,
stack = true,
consume = 0,
},
['yf_pochon_purple_haze'] = {
label = "Bag of Hash [Purple Haze]",
weight = 11,
stack = true,
consume = 0,
},
['yf_pochon_white_widow'] = {
label = "Bag of Hash [White Widow]",
weight = 11,
stack = true,
consume = 0,
},
['yf_pochon_blue_dream'] = {
label = "Bag of Hash [Blue Dream]",
weight = 11,
stack = true,
consume = 0,
},| Item | Role | Weight |
|---|---|---|
Pollen Sieveyf_tamis | Placeable station: sieving | 8,000 g |
Beating Sticksyf_baguettes | Needed to beat the sieve | 500 g |
Pollen Pressyf_presse | Placeable station: pressing | 10,000 g |
Cutting Tableyf_table | Placeable station: cutting and bagging | 15,000 g |
Empty Baggieyf_sachet_vide | Used up when bagging | 1 g |
OG Kush Budyf_tete_og_kush | Goes into the sieve | 2 g |
Purple Haze Budyf_tete_purple_haze | Goes into the sieve | 2 g |
White Widow Budyf_tete_white_widow | Goes into the sieve | 2 g |
Blue Dream Budyf_tete_blue_dream | Goes into the sieve | 2 g |
Pollen [OG Kush]yf_pollen_og_kush | Comes out of the sieve | 50 g |
Pollen [Purple Haze]yf_pollen_purple_haze | Comes out of the sieve | 50 g |
Pollen [White Widow]yf_pollen_white_widow | Comes out of the sieve | 50 g |
Pollen [Blue Dream]yf_pollen_blue_dream | Comes out of the sieve | 50 g |
Hash Slab [OG Kush]yf_plaque_og_kush | Comes out of the press | 100 g |
Hash Slab [Purple Haze]yf_plaque_purple_haze | Comes out of the press | 100 g |
Hash Slab [White Widow]yf_plaque_white_widow | Comes out of the press | 100 g |
Hash Slab [Blue Dream]yf_plaque_blue_dream | Comes out of the press | 100 g |
Hash Bar [OG Kush]yf_barrette_og_kush | Comes out of the cutting table | 10 g |
Hash Bar [Purple Haze]yf_barrette_purple_haze | Comes out of the cutting table | 10 g |
Hash Bar [White Widow]yf_barrette_white_widow | Comes out of the cutting table | 10 g |
Hash Bar [Blue Dream]yf_barrette_blue_dream | Comes out of the cutting table | 10 g |
Bag of Hash [OG Kush]yf_pochon_og_kush | Final product, ready to sell | 11 g |
Bag of Hash [Purple Haze]yf_pochon_purple_haze | Final product, ready to sell | 11 g |
Bag of Hash [White Widow]yf_pochon_white_widow | Final product, ready to sell | 11 g |
Bag of Hash [Blue Dream]yf_pochon_blue_dream | Final product, ready to sell | 11 g |
Configuration
shared/config.lua is the only file to edit. Rates, animations and positions are fixed in the script.
| Setting | Default | Effect |
|---|---|---|
Config.locale | 'fr' | Language of the texts shown to players: the name of a file in the locales/ folder. Provided: 'fr', 'en'. |
Config.tamisItems | yf_tete_* | For each strain, the items the sieve accepts as buds. Replace them with the buds of your weed script; several names are allowed per strain. A name that does not exist in ox_inventory is ignored. When a sieve is picked up, the buds returned are the first valid item in the list. |
Config.emptyBag | 'yf_sachet_vide' | The item used up as an empty baggie when bagging, one per bag. |
Config.kqWeedTables | false | true: cutting and bagging also work on the kq_weed packaging table. The script's own table works in every case. |
Config.shop | The equipment vendor: see The vendor. |
Config.locale = 'en'
Config.tamisItems = {
og_kush = { 'yf_tete_og_kush' },
purple_haze = { 'yf_tete_purple_haze' },
white_widow = { 'yf_tete_white_widow' },
blue_dream = { 'yf_tete_blue_dream' },
}
Config.emptyBag = 'yf_sachet_vide'
Config.kqWeedTables = false
Config.shop = {
enabled = true,
coords = vec4(-911.87, -1269.17, 4.22, 111.8),
currency = 'black_money',
hours = { open = 0, close = 0 },
items = {
{ item = 'yf_tamis', price = 3000, stock = -1 },
{ item = 'yf_baguettes', price = 500, stock = -1 },
{ item = 'yf_presse', price = 15000, stock = -1 },
{ item = 'yf_table', price = 5000, stock = -1 },
{ item = 'yf_sachet_vide', price = 2, stock = -1 },
},
}The production chain
One full batch, from the sieve to the bag. The rates are fixed and the same for all four strains.
YF-Kush covers production. To sell the bags, plug the items yf_pochon_og_kush, yf_pochon_purple_haze, yf_pochon_white_widow and yf_pochon_blue_dream into your dealing script.
The stations
The sieve, the press and the table are placed from the inventory: use the item, aim at the ground, ← → to rotate, E to place, Backspace to cancel. They stay in place after a restart.
- Any player can use and pick up a placed station, except while it is in use.
- Options appear within 1.5 m of the station.
- 60 stations of each type at most on the map.
Sieve
- "Load buds": only one strain at a time.
- At 100 buds, beating starts on its own, sticks in hand.
- The player sits facing the sieve; left click = two strikes.
- 5 clicks → 1 pollen, 50 clicks for the batch.
- Esc stops; "Resume sieving" carries on later.
- The sticks never wear out. Picking up the sieve returns the buds.
Press
- "Press pollen": choose the strain, 2 pollens are needed.
- Camera on the press; left click to drop each pollen into the mould.
- The character works the press and the slab appears.
- Backspace cancels before pressing, with nothing lost.
Table · cutting
- "Cut a hash slab".
- Hold left click to pick up the knife and move the mouse.
- Hold the blade on the line for 1.5 s: the bar comes off.
- 9 lines → 10 bars. You cannot fail.
- Backspace stops: the slab is kept.
Table · bagging
- "Bag the hash": up to 10 bars per round.
- The cursor appears. Hold left click to drag a baggie onto the centre slot.
- Bring a bar into contact with the baggie: the bag fills and goes onto the pile.
- Backspace stops: bags already filled are kept.
The vendor
An NPC sells the chain's equipment. He buys nothing back. He appears when players come near, during his opening hours.
| Setting | Effect |
|---|---|
enabled | false removes the vendor, if you sell the equipment elsewhere. |
coords | Feet position and heading, as vec4(x, y, z, heading). |
currency | ox_inventory item used as currency: 'black_money' or 'money'. |
hours | In-game time. open = close: always open. open > close: open at night, for example 22 → 6. |
items | Items sold, price and stock (-1 = unlimited). A limited stock refills at every restart. |
| Item sold | Default price |
|---|---|
Pollen Sieveyf_tamis | $3,000 |
Beating Sticksyf_baguettes | $500 |
Pollen Pressyf_presse | $15,000 |
Cutting Tableyf_table | $5,000 |
Empty Baggieyf_sachet_vide | $2 |
The NPC model (s_m_y_dealer_01) cannot be changed.
With kq_weed
YF-Kush works on its own. If your server uses kq_weed, three settings are enough for its buds, baggie and table to feed the chain.
Config.tamisItems = {
og_kush = { 'kq_weed_bud_og_kush' },
purple_haze = { 'kq_weed_bud_purple_haze' },
white_widow = { 'kq_weed_bud_white_widow' },
blue_dream = { 'kq_weed_bud_blue_dream' },
}
Config.emptyBag = 'kq_weed_bag_empty'
Config.kqWeedTables = trueTo accept both the kq_weed buds and the script's own, list both names: og_kush = { 'kq_weed_bud_og_kush', 'yf_tete_og_kush' }.
Languages
Every text shown to players is in locales/, readable and editable. To add a language:
- copy
locales/en.luatolocales/de.lua; - replace
Locales['en']withLocales['de']and translate the sentences; - keep the
%dand%sin the same order; - set
Config.locale = 'de'.
A missing sentence falls back to French. Item names are translated in items.lua.
Troubleshooting
Items have no image in the inventory
Check that the 25 yf_*.png files are in ox_inventory/web/images, then clear the FiveM cache: ox_inventory often keeps the old images.
The vendor refuses the sale even though I have dirty money
The name of the dirty money item depends on the server. On QBCore it is often markedbills. Set the right name in Config.shop.currency.
The sieve refuses my weed buds
Add the exact names of your buds to Config.tamisItems, under the right strain. The names must exist in ox_inventory.
The kq_weed table offers nothing
Set Config.kqWeedTables = true and check that kq_weed is started.
The player sieves without an animation
The server runs on a build that is too old. Set sv_enforceGameBuild to 2545 or higher.
A station cannot be picked up
Someone is using it: a station cannot be picked up during a batch, pressing, cutting or bagging. You also need room in your inventory.
A text shows up as a code, for example cond_count
The sentence is missing from your language file. Add the key in locales/, copying the line from fr.lua.
Editable files
The script is protected by the Cfx.re escrow. These stay readable and editable: shared/config.lua, the locales/ folder and install.sql.