> For the complete documentation index, see [llms.txt](https://shredded.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://shredded.gitbook.io/docs/paid-scripts/shr-pawnshop/configuration.md).

# CONFIGURATION

All options are in `config.lua`, `locales/`, and `fxmanifest.lua`. For requirements and setup steps, see [**Install**](broken://pages/9461124395c001727e07ad7c23d304f732b8407a).

Set `Config.Inventory` to `"qs-inventory"` or `"ox_inventory"`. Item images in the NUI load from that inventory’s image folder — use matching filenames (default: `itemname.png`).

## General settings

| Option                | Default          | Description                                  |
| --------------------- | ---------------- | -------------------------------------------- |
| `Config.Locale`       | `"en"`           | Language file in `locales/` (without `.lua`) |
| `Config.Inventory`    | `"qs-inventory"` | `"qs-inventory"` or `"ox_inventory"`         |
| `Config.ImageExt`     | `".png"`         | Suffix for item images in NUI                |
| `Config.MoneyAccount` | `"money"`        | ESX account for payout (cash = `money`)      |
| `Config.SellDuration` | `5000`           | Fallback sell time in ms                     |

`Config.ImagePath` is set automatically from `Config.Inventory`.

## Blips

```lua
Config.Blips = {
    enabled = true,
    sprite = 434,
    color = 5,
    scale = 1.05,
}
```

Per location, set `blip = false` to hide the blip for that shop only. Blip label text comes from locales (`blip.label`).

## Progress bar

Uses `exports['progressbar']:Progress`:

```lua
Config.Progress = {
    name = "pawnshop_sell",
    duration = 5000,
    useWhileDead = false,
    canCancel = true,
    controlDisables = {
        disableMovement = true,
        disableCarMovement = true,
        disableMouse = false,
        disableCombat = true,
    },
    animation = {
        animDict = "mp_common",
        anim = "givetake1_a",
        flags = 49,
    },
    prop = {},
    propTwo = {},
}
```

`Config.Progress.duration` should match the server payout delay. The server pays out after this duration (+ 300 ms buffer).

**Sell flow:** NUI → progress bar → server validates stock → removes items → adds cash → optional webhook. Cancelling the bar calls `pawnshop:cancelSell` — no items removed, no payout.

## NPC defaults

```lua
Config.NpcDefaults = {
    model = "s_m_m_shopkeep",
    fallbackModels = { "s_m_y_shop_mask", "mp_m_shopkeep_01" },
    zOffset = 0.0,
    useExactZ = true,
}
```

Per-location overrides go under `location.npc`.

## Locations

Defined in `Config.Locations`. Each entry supports a map blip, ox\_target, and either an NPC or a box zone.

```lua
{
    id = "downtown",
    coords = vector3(412.28, 314.86, 103.13),
    heading = 204.9,
    size = vector3(2.0, 2.0, 2.0),
    debug = false,
    blip = true,
    npc = {
        enabled = true,
        coords = vector4(412.28, 314.86, 103.13, 204.9),
    },
},
```

| Field         | Description                                           |
| ------------- | ----------------------------------------------------- |
| `id`          | Unique ID (zones & NPC tracking)                      |
| `coords`      | Blip / zone center                                    |
| `heading`     | Box zone rotation (degrees)                           |
| `size`        | Box zone size when NPC is off                         |
| `debug`       | ox\_target debug draw                                 |
| `blip`        | Show map blip for this shop                           |
| `npc.enabled` | `true` = NPC + target on ped; `false` = box zone only |
| `npc.coords`  | `vector4(x, y, z, heading)` for spawn                 |

* **`npc.enabled = true`** — Shopkeeper ped (fallback models if primary fails). Target the NPC to open the menu.
* **`npc.enabled = false`** — No ped; box zone at `coords`.

Add more shops by copying the block with a new `id` and coordinates. NPCs spawn on `esx:playerLoaded` / resource start and clean up on stop.

## Sellable items

```lua
Config.Items = {
    {
        item = "scrap",
        priceMin = 500,
        priceMax = 1000,
        icon = "♻️",
    },
},
```

| Field      | Description                            |
| ---------- | -------------------------------------- |
| `item`     | Inventory item name (must match qs/ox) |
| `priceMin` | Min random payout **per unit**         |
| `priceMax` | Max random payout **per unit**         |
| `icon`     | Emoji in NUI (optional)                |

**Pricing:** Server rolls one random unit price between min and max, then `total = unitPrice × amount`. Equal min/max = fixed price.

**Security:** Server re-checks count after progress; only `Config.Items` entries are sellable; pending sales clear on disconnect.

## Locales

Files in `locales/` (e.g. `en.lua`). Set in config:

```lua
Config.Locale = "en"
```

Register new files in `fxmanifest.lua` (client + server scripts), before `locale.lua`:

```lua
'locales/en.lua',
'locales/de.lua',
```

**Add a language:** copy `en.lua` → translate → add to manifest → set `Config.Locale`. Unknown locale falls back to English with a console warning.
