# Configuration

All shop settings are configured in `config.lua`, make sure to remove all the shops from your ox\_inventory/data/shops.lua!

## Global settings

```lua
Config = Config or {}

Config.UI = Config.UI or {
    accent = '#721635',
}

Config.overflowdrop = false
Config.showAllBlips = true
```

### `Config.UI`

* `accent`: this is the default shop accent color for the shop menu.
* You can override this per shop using `ui = { accent = '#2ecc71' },`.

### `Config.overflowdrop`

Controls what happens when a player buys items they cannot carry:

* `true` — extra items are dropped on the ground.
* `false` — the purchase is denied if the full cart cannot fit the players inventory.

### `Config.showAllBlips`

* `true` — show blips for every location of every shop.
* `false` — only show the closest location per shop.

## Shop entries

Each shop is defined inside `Config.Shops`.

Example:

```lua
Config.Shops = {
    General = {
        name = 'Shop',
        label = '24/7 Supermarket',
        ui = { accent = '#2ecc71' },
        blip = { id = 52, colour = 0, scale = 0.8 },
        inventory = {
            { name = 'rolling_paper', price = 5 },
            { name = 'sandwich', price = 10 },
        },
        targets = {
            {
                ped = `a_f_y_indian_01`,
                scenario = 'WORLD_HUMAN_DRINKING',
                loc = vec3(-3040.6, 584.04, 6.91),
                heading = 14.88,
                length = 0.7,
                width = 0.5,
                minZ = 7.91,
                maxZ = 8.31,
                distance = 3.0,
            },
        },
    },
}
```

### Shop fields

* `name`: internal shop identifier.
* `label`: display name shown in the gta 5 map/on shop blips.
* `ui` (optional)
  * `accent`: using this overrides the default shop color at the top of config.
* `blip` (optional)
  * `id`: blip sprite ID.
  * `colour`: blip color.
  * `scale`: blip size.
* `groups` (optional): job access requirements.
* `inventory`: list of items sold by the shop.
* `targets`: `ox_target` locations of the shop shop.

## Targets

Each entry in `targets` creates an interactable ped location.

* `ped` — model hash or model name of the NPC.
* `scenario` — ped scenario animation.
* `loc` — world coordinates (`vec3(...)`).
* `heading` — rotation heading.
* `length` / `width` — target zone dimensions.
* `minZ` / `maxZ` — vertical bounds for the target.
* `distance` — interaction distance.

## Inventory items

The `inventory` table lists items sold by the shop.

```lua
inventory = {
    { name = 'sandwich', price = 10 },
    { name = 'water_bottle', price = 10 },
}
```

* `name` must match an `ox_inventory` item name.
* `price` is the item price.
* `grade` is optional and restricts the item by job grade.
* `requireWeaponLicense` is optional and requires weapon license approval.

## Job and grade restrictions

### Shop access via `groups`

Use `groups` to restrict access to the entire shop by job and minimum grade:

```lua
groups = { police = 0 }
```

This means only players in the `police` job at grade `0` or above can use the shop.

### Item-level grade locking

Use `grade` on inventory rows to restrict a specific item:

```lua
{ name = 'smg_ammo', price = 5, grade = 4 }, -- grade 4+ only
```

### Weapon license gating

Some weapon items can require a license:

```lua
{ name = 'weapon_pistol', price = 2500, requireWeaponLicense = true }
```

If your server uses license handling, ensure the license is granted through your MDT or license system.

## Example shop definitions

Some common shops are included with the script, add/edit as many as you want.


---

# 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://w-labs.gitbook.io/w-labs-docs/scripts/wlabs-shops/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.
