A modern, feature-rich weed cultivation system for FiveM servers using QBCore/QBXCore with ox_lib/ox_inventory support.
- Realistic Growth System - Plants grow over 2 hours with 5 visual stages
- NPK Fertilizer System - Nitrogen, Phosphorus, Potassium management with min/max values
- Strain Genetics - Deterministic strain naming based on NPK values (63,000+ possible strains)
- Quality System - Dynamic quality calculation based on NPK ratios and water levels
- Water Management - Plants require watering every 15 minutes
- Ground Type Modifiers - 9 different ground surfaces affect plant growth
- Male/Female Plants - Breeding system with seed generation
- Reputation System - Track player expertise with named strains
- Modern UI - Support for ox_lib, qb-input, qb-menu, ox_target
- Inventory Integration - Works with ox_inventory and qb-core inventory
- Framework: QBCore or QBXCore
- Dependencies:
- ox_lib
- ox_target (optional, falls back to qb-target)
- oxmysql
- ox_inventory (optional)
- Download or clone this repository
- Place the
z-weedsystemfolder in your server's directory and enusre inserver.cfg - Ensure all dependencies are installed and started before z-weedsystem
Import the SQL file to your database:
Or import via phpMyAdmin/HeidiSQL by running the weed.sql file.
Edit config.lua to customize:
PlantConfig = {
GrowthTime = 120, -- Plant growth time in minutes (120 = 2 hours)
WaterDepletion = 5, -- Water depletion interval in minutes and also level of water depleted
WaterAdd = 20, -- How much water one bottle adds
HarvestPercent = 95, -- Minimum growth % to harvest
MaleFactor = 1.3, -- Male plants grow 30% slower compared to female plant
FertilizerFactor = 1.54, -- Fertilizer effectiveness multiplier
-- ... more settings
}ensure ox_lib
ensure ox_target / qb-target
ensure oxmysql
ensure ox_inventory # Optional
ensure z-weedsystem- Get a female weed seed (from male plants or NPC shops)
- Use the seed item from your inventory
- Aim at valid ground (grass, wet ground, etc.)
- Press E to plant (within 2.5m of your character)
- Press Backspace to cancel
- Water plants every 15 minutes using water bottles
- Add fertilizer (once per plant) with custom NPK values:
- Nitrogen (N): 1-80
- Phosphorus (P): 1-61
- Potassium (K): 1-20
- Monitor growth - 5 visual stages from seedling to harvest-ready
- Harvest at 95%+ growth for best yields
- Hold a female seed with genetics
- Access the strain menu (via item or command)
- Name your strain - creates a unique name based on NPK values
- Reuse strains - plant new seeds with the same genetics
Quality is calculated based on:
- NPK Sum - Higher values = better quality
- Water Factor - Optimal at 70-80% water
- Ground Type - Wet ground (type 8) gives best modifiers
- Fertilizer - Apply once at the right growth stage
Perfect Strain Example:
- N=80, P=61, K=20 (max values)
- Water at 75%
- Plant on wet ground
- Result: Legendary quality!
| Action | Control |
|---|---|
| Plant Seed | E (when aiming at valid ground) |
| Cancel Planting | Backspace or G |
| Harvest Plant | E (when near mature plant) |
| Inspect Plant | E (target interaction) |
female_weed_seed- Produces buds when harvestedmale_weed_seed- Produces more seeds when harvestedtrowel- Required to plant seedssmall_scale- Required for packagingrolling_paper- Required for making jointswater_bottle- Waters plants (adds 20% water)weed_nutrition- Fertilizer (adds NPK values)wet_weed_bud- Harvested buds (needs drying)dry_weed_bud- Dried buds (can package)packed_weed_bud- Packaged weed (can make joints)weed_baggy- Bagged weed (24 per package)joint- Ready-to-smoke joints (10 per pack)
-- Works out of the box
-- Uses: Framework.Functions.GetPlayerData()
-- Uses: Framework.Functions.HasItem()
-- Uses: Framework.Functions.Notify()-- Auto-detected
-- Uses: exports.qbx_core:GetCoreObject()
-- Uses: exports.qbx_core:GetPlayer()-- Auto-detected
-- Uses: exports.ox_inventory:Search()
-- Uses: exports.ox_inventory:AddItem()
-- Uses: exports.ox_inventory:RegisterUsableItem()-- Falls back automatically
-- Uses: Framework.Functions.GetItemByName()
-- Uses: Framework.Functions.AddItem()- Uses
lib.notify()for notifications - Uses
lib.progressBar()for progress bars - Uses
lib.inputDialog()for input dialogs - Uses
lib.showContext()for context menus
- Falls back automatically
- Uses
exports['qb-input']:ShowInput() - Uses
exports['qb-menu']:openMenu()
exports.ox_target:addModel()
exports.ox_target:addLocalEntity()exports['qb-target']:AddTargetModel()
exports['qb-target']:AddTargetEntity()- Check
GrowthTimein config (default 120 minutes) - Verify server time with
GetCloudTimeAsInt()
- Ensure plant is not at 100% growth
- Check if fertilizer was already added (
plant.fertilizer == 1) - Verify you have
weed_nutritionitem
- Ensure NPK values are set on the seed metadata
- Check
getStrainName()function incl_utils.lua
- Verify
weed.sqlwas imported correctly
- โ Fixed fertilizer growth restriction (now 100% instead of 80%)
- โ Added planting distance limit (2.5m from player)
- โ Added DrawText UI for planting controls
- โ Fixed NPK input min/max validation
- โ Improved SQL schema (utf8mb4, proper primary keys)
- โ
Fixed
getRepstring()function - โ Added Backspace as cancel key
This project is licensed under the GNU GPLv3 License - see the LICENSE file for details.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
- Issues: GitHub Issues
- Discord: Join our community ([https://discord.gg/ekYJeWB])
Made with โค๏ธ for the FiveM community