# anox-drugsell

<figure><img src="/files/OywQBkG4oBZxry9FmoFc" alt=""><figcaption></figcaption></figure>

### ✨ Overview

> **anox-drugsell** is a zone-based drug system with dynamic prices and a rep system. Sell more to build rep for each drug, increasing your chances of successful NPC deals. Set your own prices—but if your rep is low and your price is high, NPCs might reject you or alert the police.

### ✨ Features

* [ ] 📡 **Built-in Dispatch Alert System**

- Uses `ox_lib`  for dispatch.
- Police can be alerted based on player’s price and rep.
- Base alert chance is 10% (fully configurable).

* [ ] 🌍 **Zone-Based Selling System**

- Prices vary by zone — some give higher payouts.
- Uses a multiplier system (easily configurable).
- Option to enable/disable zone-based pricing.

* [ ] 📊 **Detailed Sell Feedback (Optional)**

- Players can view dispatch chance, success chance, and zone info.
- Can be disabled for cleaner experience or more serious RP.

* [ ] 🚫 **Blacklisted Jobs Restriction**

- Certain jobs (e.g., police) can be blocked from selling drugs.

* [ ] 💰 **Custom Drug Pricing System**

- Players set their own selling price.
- Each drug has a configurable min/max price.
- Option to receive either dirty money or clean cash.

* [ ] 📈 **Drug Reputation System**

- Gain rep for each specific drug you sell.
- More rep = better chances of NPCs buying.
- Max rep per drug is 100 (configurable).
- Failed deals reduce rep — price smart!
- Rep is saved in the database for a smooth experience.

* [ ] ➕ **Add Unlimited Drugs**

- Easily add any number of drugs in the config file.

* [ ] 🧠 **NPC Behavior**

- NPCs walk up and wait a set amount of time (configurable) during `/drugsell`.
- Difficulty and patience levels can be adjusted.
- You can choose which drug to sell in Drug Selling Menu.

* [ ] 🔧 **Framework Compatibility**

- Fully tested with **ESX**, **QBCore**, and **Qbox**.
- **Localization support** through `ox_lib`.

### ✨ Requirements

* [ ] One of the following frameworks:

- `ESX`
- `QBCore`
- `Qbox`

* [ ] One of the following target systems:

- [`ox_target`](https://github.com/overextended/ox_target)
- [`qb-target`](https://github.com/qbcore-framework/qb-target)

* [ ] **Must-have dependencies:**

- [`ox_lib`](https://github.com/overextended/ox_lib)
- [`oxmysql`](https://github.com/overextended/oxmysql)

### ✨ Installation Guide

* [ ] **Step 1: Download the** [**Resource**](https://github.com/ANoXShadow/anox-drugsell)
* [ ] Download the resource from our GitHub repository
* [ ] Extract the files to your server's `resources` folder
* [ ] Rename the folder to `anox-drugsell`if it's not already named correctly
* [ ] **Step 2: Database Setup**
* [ ] Run the following SQL query on your database:

```sql
CREATE TABLE IF NOT EXISTS `anox_drugrep` (
  `license` varchar(50) NOT NULL,
  `drug` varchar(50) NOT NULL,
  `rep` int(11) NOT NULL DEFAULT 0,
  PRIMARY KEY (`license`, `drug`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
```

* [ ] **Step 3: Configure Your server.cfg**
* [ ] Add the following line to your `server.cfg` file:

```
ensure oxmysql
ensure ox_lib
ensure anox-drugsell
```

**Step 4: Configure the Resource**

* Open the `config.lua` file in the `anox-drugsell`folder
* Set your preferred framework:
  * `Config.Framework = 'esx'` for ESX
  * `Config.Framework = 'qbcore'` for QBCore
  * `Config.Framework = 'qbox'` for QBox

### ✨ Preview

{% embed url="<https://www.youtube.com/watch?v=H_IpnXKoKDI>" %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://anoxstudios.gitbook.io/anoxstudios/free-scripts/illegal/anox-drugsell.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
