[ESX] Drugs Harvest

35.00EUR

[ESX] Drugs Harvest System

Package Description

A lightweight, production-ready drug harvesting system with time-rotating locations, multi-drug support, object-based plants, and clean client/server sync. Ships with English & Dutch locales, oxmysql logging, optional ox_target interactions or textUI via open_client, and automatic plant respawn after harvest.

Highlights

  • Time Rotation: Hourly / daily / custom interval rotation for location sets.

  • Multi-Drug Types: Configure Weed, Coca, Meth (or your own). Each can have unique models, items, and yield ranges.

  • Clusters per Spot: Spawn multiple plants around a base point with ring/golden/random patterns.

  • Object Lifecycle: Plants spawn as world objects, despawn on harvest, and respawn automatically (default 30s).

  • Target or TextUI: Works with ox_target or a TextUI fallback through open_client (with ox_lib fallback).

  • Ground Placement: Plants snap to the terrain and align properly using ground probes + PlaceObjectOnGroundProperly.

  • Player Feedback: Optional shovel/trowel emote + progress circle while harvesting.

  • Framework-Agnostic Rewards: ESX / QBCore bridges included (items/money) with safe initialization.

  • Database Logging: Each harvest can be logged to MySQL via oxmysql.

  • Locales: EN/NL out of the box. Easy to add more.

What’s included

  • Structured resource with modular server (rotation, clusters, spots, cooldown, logging, rewards) and clean client (UI, interaction).

  • Example configs for multiple drugs and clustered spots.

  • SQL file to create a simple cld_drug_sales log table.

Requirements

  • Required: ox_lib, oxmysql

  • Optional: ox_target (for target interactions), open_client (for notifications/textUI)

  • Framework: Works standalone; rewards adapters included for ESX & QBCore.

Key Features in Detail

  • Configurable Respawn: Config.RespawnAfterHarvestMs (default 30s) — plants return automatically for all players after a lockout.

  • Consistent Networking: Server broadcasts despawn/respawn; client mirrors for smooth visuals.

  • Rotation Modes:

    • hourly (changes set every hour)

    • daily (changes set per day of year)

    • interval (custom minute interval)

  • Clusters: Per spot: count, radius, pattern (ring/golden/random) – perfect for farms and groves.

  • Safety & UX: Guards for missing open_client, clean ox_target removal, robust ground Z checks.

Installation

  1. Drop the folder into resources/[local]/cld-drugssystem/.

  2. Import sql/001_init.sql into your database.

  3. Ensure start order: ox_lib, oxmysql, (optional ox_target, open_client), then cld-drugssystem.

  4. Configure in config.lua:

    • Config.OpenClientResource → your open_client resource name (or empty to use ox_lib only).

    • Config.UseTarget = true/false to enable/disable ox_target.

    • Config.Rotation → choose hourly, daily, or interval (+ minutes).

    • Config.Drugs → define drug models, item names, and yields.

    • Config.LocationSets → add your locations; use cluster = { count, radius, pattern } to spawn many plants per spot.

    • Config.RespawnAfterHarvestMs → set plant respawn time.

  5. Make sure your inventory system has the configured items (e.g., weed_leaf, coca_leaf, ephedra_leaf) or adjust names.

Compatibility

  • ESX / QBCore: Reward bridges included (items & money).

  • Inventory: Works with ox_inventory/ESX/QB once items exist.

  • Any Map: Grounding logic places props correctly on hills/uneven terrain.

Performance

  • Efficient spawn/despawn and cluster generation.

  • Rate-limited checks and minimal per-frame work.

  • Uses ipairs and cached sets for consistent indices & low overhead.

Configuration Snippets (Examples)

  • Per-spot clustering: cluster = { count = 8, radius = 2.5, pattern = 'golden' }

  • Per-spot drug type: drug = 'weed' | 'coke' | 'meth' | 'your_custom_key'

  • Rotation: mode = 'interval', intervalMinutes = 30

Support & Customization

  • Add more drug types, items, and models in Config.Drugs.

  • Swap the emote prop or animation easily.

  • Need unique respawn times per drug/spot, growth stages, or police alerts? The server is modular—easy to extend.

167373427b80868a864799b027aa6039b15ed0ec.png