> ## Documentation Index
> Fetch the complete documentation index at: https://docs.shdevelopment.org/llms.txt
> Use this file to discover all available pages before exploring further.

# sh-drugs: Multi-Drug Economy Script for FiveM

> sh-drugs adds four drug operations — weed, cocaine, meth, and LSD — each with gathering, processing, and NPC selling. Supports ND_Core and standalone.

sh-drugs gives your FiveM server four complete, independent drug production chains — weed, cocaine, meth, and LSD. Each chain follows the same three-stage loop: gather raw materials in the world, buy processing supplies from a vendor, work inside a dedicated interior, and sell the finished product to roaming NPC dealers. Every stage is configurable, from processing speed and sale prices to the chance that an NPC panics and calls the police.

## Dependencies

sh-drugs requires the following resources before you start the script:

* [PolyZone](https://github.com/mkafrin/PolyZone) — zone detection for farm, processing, and sell areas
* [ox\_lib](https://github.com/overextended/ox_lib) — progress bars, notifications, and UI components
* [bob74\_ipl](https://github.com/bob74/bob74_ipl) — interior streaming for the Cocaine Lockup and Meth Lab

[ox\_target](https://github.com/overextended/ox_target) is optional but recommended; enabling it reduces per-frame script overhead.

<Warning>
  `bob74_ipl` must be started **before** sh-drugs in your `server.cfg`. Without it, the Cocaine Lockup and Meth Lab interiors will not load and players will fall through the map when entering those zones.
</Warning>

## Supported Frameworks

| Value        | Framework                              |
| ------------ | -------------------------------------- |
| `standalone` | No framework — cash handled internally |
| `nat`        | NAT2K15 framework                      |
| `nd`         | ND\_Core                               |

## Drug Workflows

Each drug follows the same gather → process → sell loop, but with unique locations, supplies, and interiors.

| Drug    | Gather Method                        | Processing Supply                                                             | Interior           |
| ------- | ------------------------------------ | ----------------------------------------------------------------------------- | ------------------ |
| Weed    | Harvest weed plants from a farm zone | Scissors (\$100)                                                              | Biker DLC interior |
| Cocaine | Plant and harvest from a farm zone   | Razor Blades (\$100)                                                          | Cocaine Lockup     |
| Meth    | Collect materials from an NPC zone   | Baking Powder, Soda, Battery Acid, Chloroform, Hydrogen Peroxide (\$100 each) | Meth Lab           |
| LSD     | Collect materials from an NPC zone   | Lysergic Acid, Morning Glory Seeds (\$100 each)                               | Custom location    |

## Key Mechanics

<Accordion title="Cop-Call System">
  Every time a player sells drugs to an NPC, the script rolls against `Config.ChanceToCallCops`. On a hit, a server-wide police alert fires and broadcasts the GPS coordinates of the sale to all online players. Set this value to `0` to disable alerts entirely.
</Accordion>

<Accordion title="Drug Effects on Consumption">
  When a player consumes a drug using a `/take*` command, the script applies real GTA V screen effects (colour grading, blur, shaking) and temporary stat bonuses for the duration set in `Config.EffectTime`. Each drug has distinct visual effects to differentiate the experience.
</Accordion>

<Accordion title="Time-Gated Dealers">
  NPC drug buyers only appear between the in-game hours defined by `Config.MinimumTime` and `Config.MaximumTime`. Players who arrive outside that window will find no dealers and cannot sell. This encourages active play during peak server hours.
</Accordion>

## Configuration

Open `shared/config.lua` to adjust all core settings. The values below are the defaults shipped with the resource.

```lua shared/config.lua theme={null}
Config.Framework    = 'standalone'  -- 'standalone', 'nat', 'nd'
Config.OxTarget     = false          -- true = use ox_target (better ms)

Config.ChanceToCallCops   = 20    -- % chance an NPC sale calls police
Config.SellToNPCDistance  = 10.0  -- Max distance to sell to an NPC
Config.MinimumTime        = 5     -- Earliest in-game hour dealers appear
Config.MaximumTime        = 22    -- Latest in-game hour dealers appear

Config.AmountToProcess = { Weed = 2, Coke = 4, Meth = 4, LSD = 4 }   -- Raw units per process
Config.ProcessTime     = { Weed = 10, Coke = 10, Meth = 10, LSD = 10 } -- Seconds per process
Config.DrugPrices      = { Weed = 100, Coke = 100, Meth = 100, LSD = 100 } -- $ per unit sold
Config.EffectTime      = { Weed = 100, Coke = 100, Meth = 100, LSD = 100 } -- Effect duration (s)
```

<Tip>
  Lower `Config.AmountToProcess` values make the operation faster and more accessible for new players. Raise them alongside `Config.DrugPrices` to create a higher-risk, higher-reward economy on established servers.
</Tip>

## Installation

<Steps>
  <Step title="Add dependencies to server.cfg">
    Start all required resources **above** sh-drugs in your `server.cfg`:

    ```cfg server.cfg theme={null}
    ensure PolyZone
    ensure ox_lib
    ensure bob74_ipl
    ensure sh-drugs
    ```
  </Step>

  <Step title="Set your framework">
    Open `shared/config.lua` and set `Config.Framework` to match your server:

    ```lua theme={null}
    Config.Framework = 'nd'  -- change to 'standalone' or 'nat' as needed
    ```
  </Step>

  <Step title="Enable ox_target (optional)">
    If you run ox\_target on your server, flip the flag and add `ox_target` above sh-drugs in `server.cfg`:

    ```lua theme={null}
    Config.OxTarget = true
    ```
  </Step>

  <Step title="Tune economy values">
    Adjust prices, processing times, and the cop-call chance to fit your server's economy before going live.
  </Step>

  <Step title="Restart and test">
    Restart the resource and walk through each drug chain in-game to confirm interiors load and NPC zones are active.
  </Step>
</Steps>

## Inventory & Consumption Commands

Players use the following commands to check their inventory and consume drugs. All commands run client-side and require no ACE permissions.

| Command          | Description                                           |
| ---------------- | ----------------------------------------------------- |
| `/weedinventory` | Show current weed, processed weed, and scissors count |
| `/cokeinventory` | Show current cocaine inventory                        |
| `/methinventory` | Show current meth inventory                           |
| `/lsdinventory`  | Show current LSD inventory                            |
| `/takeweed`      | Consume one weed unit and apply screen effects        |
| `/takecoke`      | Consume one cocaine unit and apply screen effects     |
| `/takemeth`      | Consume one meth unit and apply screen effects        |
| `/takelsd`       | Consume one LSD unit and apply screen effects         |
| `/selldrugs`     | Open the NPC sell menu (must be inside a sell zone)   |

<Note>
  The `/selldrugs` command only works when you are within `Config.SellToNPCDistance` of an active NPC dealer and during the configured dealer hours. Outside those conditions the command produces no output.
</Note>

## Tabs by Drug

<Tabs>
  <Tab title="Weed">
    **Gather:** head to the farm zone and harvest weed plants directly from the crop rows.

    **Supply:** buy Scissors from the supply vendor for \$100.

    **Process:** enter the Biker DLC interior and begin processing. Two raw weed units yield one processed unit (`Config.AmountToProcess.Weed = 2`).

    **Sell:** find a dealer active between `MinimumTime` and `MaximumTime` and use `/selldrugs`.
  </Tab>

  <Tab title="Cocaine">
    **Gather:** plant and harvest from the cocaine farm zone.

    **Supply:** buy Razor Blades from the supply vendor for \$100.

    **Process:** enter the Cocaine Lockup interior (requires `bob74_ipl`). Four raw coke units yield one processed unit.

    **Sell:** find an active dealer and use `/selldrugs`.
  </Tab>

  <Tab title="Meth">
    **Gather:** collect raw materials from the NPC zone. Five separate supplies are required: Baking Powder, Soda, Battery Acid, Chloroform, and Hydrogen Peroxide (\$100 each).

    **Process:** enter the Meth Lab interior (requires `bob74_ipl`). Four raw units yield one processed unit.

    **Sell:** find an active dealer and use `/selldrugs`.
  </Tab>

  <Tab title="LSD">
    **Gather:** collect raw materials from the NPC zone. Two supplies are required: Lysergic Acid and Morning Glory Seeds (\$100 each).

    **Process:** enter the custom LSD location. Four raw units yield one processed unit.

    **Sell:** find an active dealer and use `/selldrugs`.
  </Tab>
</Tabs>
