# Illicit Sales

### ⚡ Quick Overview

* **No database required:** All logic is handled in memory.
* **Ready-to-use** with VORP, including menu and interaction support.
* **All sales, police, and NPC reactions are configurable via `config.lua`.**

***

### 🟦 Client Side

#### 🔌 Export: Protect NPCs from Illicit Sales

Prevent any NPC entity from being used for illicit sales with:

```lua
exports.bt_illicitsales:addNPCToBlackList(entity)
```

***

### ⚙️ Configuration (`config.lua`)

<pre class="language-lua"><code class="lang-lua">Config = {}
Config.DEBUG = false
Config.UseVorpMenu = true -- true -> use VORP MENU/false-> use Warmenu
-- Chance for an NPC to alert authorities, ignore you or to fight you. If alerted, the NPC will run to the AlertPoint defined in Config.TownAllowed.
Config.AlertChance = 5 -- Chance in percent to alert
Config.FightChance = 5 -- Chance in percent to fight
Config.IgnoreChance = 5 -- Chance in percent to ignore
Config.OnlyMaleCanFight = true -- Only male npc ped can fight
Config.CanSellToPoliceNPC = false -- You can sell to Policeman :)
Config.SellKey = keys["U"] -- The key for open sell menu
Config.ShowGuilty = keys["G"] -- The key for show guilty to player who can talk to NPC (Config.PoliceJobs)

-- Define whether illegal sales are restricted to certain hours or allowed all day long.
Config.IllegalSellClock = true -- true -> sells only during the hours defined in Config.IllegalHours / false -> sells all day long
Config.IllegalHours = {
        start = { hour = 20, min = 0 },  -- Start time for illegal sales
        finish = { hour = 23, min = 0 }, -- End time for illegal sales
        timeFormat = '24h' -- Format of the hours: '24h' or '12h'
}
--
-- min Police connected to enable players to sell
Config.MinPolice = 0
-- List of jobs that can talk to NPC to see the guilty
Config.PoliceJobs = {
    "sheriff", -- Sheriff
    "gouv"    -- Government official
}
--
-- List of jobs that are not allowed to engage in illegal sales.
Config.BlackListedJobs = {
    "sheriff", -- Sheriff
    "gouv"    -- Government official
}
<strong>
</strong><strong>
</strong>-- Pricing for illegal items.
-- Action (animation) : "drink" or "smoke" or "pocket"
Config.IllegalPrice = {
    ["beer"] = { -- item name (from DB items)
        label = "Beer", -- item label
        price = 5, -- item price
        action = "drink", -- animation
        description = "a good and nice beer !" -- description for vorp menu
    },
    -- this content is hidden in the excerpt
}

-- Zones where illegal sales are allowed. Each zone has a type, a name hash, and an alert point for NPCs to run to if they alert authorities.
Config.TownAllowed = {
    ["BlackWater"] = {
        ZoneTypeId = 1,
        ZoneNameHashDec = 1053078005,
        AlertPoint = { x = -755.23, y = -1268.97, z = 44.02 }
    },
    -- this content is hidden in the excerpt
}
</code></pre>

### 📌 Notes

* **No database setup required:** Items and settings are fully configurable.
* **Flexible:** NPC behavior, pricing, police rules, and allowed areas can be tweaked easily.
* **Safe NPCs:** You can blacklist any NPC entity from illicit sales via client export.


---

# 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://botiv.gitbook.io/rdr2/illicit-sales.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.
