# Configuration

***

### 🧩 Core Settings

```lua
Config.Framework = 'auto'
Config.Inventory = 'auto'
Config.Target    = 'ox_target'
```

| Option      | Accepted Values                                                             | Description                                                     |
| ----------- | --------------------------------------------------------------------------- | --------------------------------------------------------------- |
| `Framework` | `auto` / `qbcore` / `qbox` / `esx`                                          | Selects the active framework. `auto` enables runtime detection. |
| `Inventory` | `auto` / `qb-inventory` / `ox_inventory` / `esx_inventory` / `qs-inventory` | Defines the inventory system used by the server.                |
| `Target`    | `none` / `ox_target` / `qb-target` / `interact`                             | Defines the targeting/interaction system for NPCs.              |

{% hint style="info" %} Leaving these on `auto` is recommended unless you intentionally want to override detection. {% endhint %}

***

### 💵 Currency Settings

```lua
Config.CashRollItem  = "moneyroll"
Config.CashRollsName = "Cash Rolls"
```

| Option          | Description                                                        |
| --------------- | ------------------------------------------------------------------ |
| `CashRollItem`  | The internal item name used as an in-game currency representation. |
| `CashRollsName` | The display label shown in the user interface for that currency.   |

***

### 🌙 Night Time Restrictions

```lua
Config.NightTime = {
    Enable = false,
    Start  = 21,
    End    = 6
}
```

| Field    | Type         | Description                                    |
| -------- | ------------ | ---------------------------------------------- |
| `Enable` | `boolean`    | Toggles whether night-time restrictions apply. |
| `Start`  | `int (0–23)` | Starting hour of the night window.             |
| `End`    | `int (0–23)` | Ending hour of the night window.               |

***

### 📡 Webhook

```lua
Config.Webhook = ""
```

A Discord webhook URL used to log critical events such as sales, purchases, or suspicious activity. Leave the field empty to disable logging.

***

### 👨‍💼 Big David — The Vendor

```lua
Config.BigDavid = {
    PedModel     = "s_m_y_dealer_01",
    PedAnimation = "WORLD_HUMAN_SMOKING_CLUBHOUSE",
    Label        = "Talk Big David",
    Distance     = 4,
    InteractDst  = 2,
    Title        = "Big David",
    Subtitle     = "Heist tools and breaking gear",
    ...
}
```

#### General Configuration

| Field          | Description                                                        |
| -------------- | ------------------------------------------------------------------ |
| `PedModel`     | The in-game ped model spawned at each defined location.            |
| `PedAnimation` | The scenario animation played by the ped while idle.               |
| `Label`        | The interaction text shown above the target.                       |
| `Distance`     | The maximum range at which the interaction option is visible.      |
| `InteractDst`  | The maximum range at which the player can trigger the interaction. |
| `Title`        | The main heading displayed at the top of the UI.                   |
| `Subtitle`     | The secondary descriptive line under the title.                    |

#### Blip Configuration

```lua
Blip = {
    Enable = false,
    Name   = "Big David",
    Sprite = 66,
    Color  = 0,
    Scale  = 0.7
}
```

| Field    | Description                        |
| -------- | ---------------------------------- |
| `Enable` | Toggles map blip visibility.       |
| `Name`   | The label shown in the map legend. |
| `Sprite` | The numeric blip icon ID.          |
| `Color`  | The blip color index.              |
| `Scale`  | The blip size multiplier.          |

#### Locations

```lua
Locations = {
    vector4(-1150.87, -1519.22, 4.36, 130.53),
}
```

Each `vector4` defines a spawn point: `x`, `y`, `z`, and the ped's heading. You may declare multiple locations to spawn the same vendor across different areas.

***

### 💰 Miss Boney — The Buyer

```lua
Config.Buyer = {
    PedModel     = "g_m_m_armboss_01",
    PaymentType  = "cash",
    PaymentItem  = "money",
    ...
}
```

#### Payment Type

| Value  | Behavior                                                      |
| ------ | ------------------------------------------------------------- |
| `cash` | Player is paid directly in cash.                              |
| `bank` | Funds are transferred to the player's bank account.           |
| `item` | Player receives a quantity of `PaymentItem` instead of money. |

#### Time Window

```lua
Time = {
    Enable = false,
    Mode   = "night",
    Start  = 20,
    End    = 5
}
```

| `Mode`   | Behavior                                              |
| -------- | ----------------------------------------------------- |
| `night`  | Buyer is only available during in-game night hours.   |
| `day`    | Buyer is only available during in-game daytime hours. |
| `custom` | Uses the explicit `Start` and `End` hour values.      |

***

### 🛒 Sellable Items — `Config.SellItems`

Defines the items that the buyer NPC will purchase from players, along with pricing and quantity limits.

```lua
Config.SellItems = {
    {
        label       = "Bag",
        item        = "bag",
        price       = 150,
        description = "Old duffel bag, no questions asked.",
        maxPerSell  = 10,
    },
    ...
}
```

| Field         | Type     | Description                                                   |
| ------------- | -------- | ------------------------------------------------------------- |
| `label`       | `string` | Display name shown in the UI.                                 |
| `item`        | `string` | Internal item name registered in the inventory.               |
| `price`       | `number` | Payout per unit sold.                                         |
| `description` | `string` | Short flavor text or descriptor for the item.                 |
| `maxPerSell`  | `number` | Maximum quantity the player can sell in a single transaction. |

***

### 🗂️ Categories — `Config.Categories`

Defines the filter tabs used in the shop interface.

```lua
Config.Categories = {
    { id = "all",     label = "ALL"     },
    { id = "tools",   label = "TOOLS"   },
    { id = "heist",   label = "HEIST"   },
    { id = "weapons", label = "WEAPONS" },
    { id = "ammo",    label = "AMMO"    },
}
```

| Field   | Description                                                |
| ------- | ---------------------------------------------------------- |
| `id`    | Unique identifier referenced by `Config.Items[].category`. |
| `label` | Display label shown in the UI filter bar.                  |

{% hint style="success" %} The `all` category is required. Removing it will break the default item view. {% endhint %}

***

### 🎒 Shop Items — `Config.Items`

Defines the inventory available for purchase from Big David.

```lua
Config.Items = {
    {
        label       = "Bag",
        item        = "bag",
        price       = 300,
        category    = "tools",
        description = "A large duffel bag for carrying loot.",
        minStock    = 5,
        maxStock    = 15,
    },
    ...
}
```

| Field         | Type     | Description                                       |
| ------------- | -------- | ------------------------------------------------- |
| `label`       | `string` | Display name shown in the UI.                     |
| `item`        | `string` | Internal item name registered in the inventory.   |
| `price`       | `number` | Cost per unit.                                    |
| `category`    | `string` | Must match a defined `id` in `Config.Categories`. |
| `description` | `string` | Short descriptor shown on the item card.          |
| `minStock`    | `number` | Lower bound for randomized stock generation.      |
| `maxStock`    | `number` | Upper bound for randomized stock generation.      |

{% hint style="warning" %} Stock values are randomized per cycle between `minStock` and `maxStock`. Ensure both values reflect realistic, balanced ranges. {% endhint %}

***

### 📌 Best Practices

* Every item referenced in `SellItems` or `Items` must exist in your server's item registry.
* Category IDs in `Config.Items` must match `Config.Categories` exactly — comparisons are case-sensitive.
* Time-based restrictions (`NightTime`, `Buyer.Time`) follow the in-game world clock, not the real server clock.
* Use unique `id` values across all targets to avoid conflicts with other scripts.


---

# 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://x8project.gitbook.io/x8project/projects/big-david/configuration.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.
