> For the complete documentation index, see [llms.txt](https://docs.hyper-code.eu/documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.hyper-code.eu/documentation/shop-system/config.md).

# Shop System – Configuration

All options in shared/config.lua of Shop System: framework, inventory, notifications, shops, items, prices, markers, peds, translations and colours.

All settings are in `shared/config.lua`. This file is not escrowed.

## General

| Option                         | Default                                 | Description                                                                                                                                                        |
| ------------------------------ | --------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `Config.Framework`             | `"es_extended"`                         | Resource name of your framework (`es_extended`, `qb-core` or a renamed core). ESX is detected via `getSharedObject`, QBCore via `GetCoreObject`.                   |
| `Config.CustomQBInventoryName` | `"qb-inventory"`                        | QBCore only. Name of your inventory resource if it is renamed. Used for the free-weight check (`GetFreeWeight`) when `qb-inventory` itself is not found.           |
| `Config.General.IconPath`      | `"nui://hc_inventory/html/dist/items/"` | Folder with your item images, as `nui://<resource>/<path>/`. The UI loads `<Name>.png`. Change it to your inventory, for example `nui://ox_inventory/web/images/`. |

### Free-weight check

Before a purchase the script compares the weight of the cart with the free weight of the player:

| Setup               | Free weight from                                                                                                        |
| ------------------- | ----------------------------------------------------------------------------------------------------------------------- |
| ESX + ox\_inventory | `ox_inventory` (`CanCarryWeight`)                                                                                       |
| ESX                 | `getMaxWeight()` − `getWeight()`                                                                                        |
| QBCore              | `qb-inventory` `GetFreeWeight`, else the resource in `Config.CustomQBInventoryName`. If neither is found, 1000 is used. |

## Notifications

```lua
Config.ShowNotification = function(source, message, title, type)
    if IsDuplicityVersion() then -- server side
        TriggerClientEvent("hc_notify:notify", source, message, title, type, 5000)
    else -- client side
        exports['hc_notify']:notify(message, title, type, 5000)
    end
end

Config.ShowHelpNotification = function(message)
    exports['hc_notify']:helpNotify(message, 'E', -1)
end
```

Replace the calls with your own notification resource if you do not use [Premium Notify](https://shop.hyper-code.eu/package/6496308).

## Shops

`Config.Shops` is a list. Every shop has its own items and can have any number of locations:

```lua
Config.Shops = {
    {
        Name = "24/7 Shop",
        Blip = { Id = 52, Color = 2, Size = 0.8 },
        Marker = {
            Type = 30,
            Color = { R = 254, G = 9, B = 67, A = 150 },
            Size = 0.6,
            DrawDistance = 10
        },
        Ped = {
            SpawnPed = true,
            Model = "a_m_m_soucent_04",
            Positions = {
                vector4(24.484, -1347.351, 29.497, 271.351),
            },
        },
        Items = {
            { Type = "item", Name = "water", Price = 500 },
            { Type = "weapon", Name = "WEAPON_PISTOL", Price = 15000 },
        },
        Positions = {
            vector3(25.7, -1347.3, 29.49),
        }
    },
}
```

| Field           | Description                                                                                                                                                                  |
| --------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Name`          | Shop name in the UI and on the blip                                                                                                                                          |
| `Blip`          | `Id` (sprite), `Color` and `Size`. A blip is created at every entry in `Positions`.                                                                                          |
| `Marker`        | `Type`, `Color` (`R`, `G`, `B`, `A`), `Size` and `DrawDistance`. The marker is drawn within `DrawDistance`. The shop opens with **E** when the player is closer than `Size`. |
| `Ped.SpawnPed`  | Spawn shop attendants                                                                                                                                                        |
| `Ped.Model`     | Ped model                                                                                                                                                                    |
| `Ped.Positions` | One `vector4` per ped (`x, y, z, heading`). Independent from `Positions`.                                                                                                    |
| `Items`         | Items for sale: `Type` (`"item"` or `"weapon"`), `Name` and `Price` per piece                                                                                                |
| `Positions`     | Interaction points (`vector3`) of this shop                                                                                                                                  |

{% hint style="info" %}
`Ped.Positions` and `Positions` are separate lists. Put the interaction point a little in front of the ped so players can reach it. With `Marker.Size = 0.6` players must stand very close; raise it if the shop is hard to open.
{% endhint %}

### Buying

* Players put up to 99 of one item into the cart.
* They pay with **Cash** (`money`) or **Card** (`bank`).
* Weapons are given once, without extra ammo. If the player already has that weapon, the purchase is cancelled.
* If the cart is heavier than the free weight, the purchase is cancelled.

## Translations and colours

* `Config.Translation` contains every text in the UI and in the notifications. `NotifyTitle` is the title of all shop notifications. `ItemCount` uses `%s` for the number of items.
* `Config.Style` sets the two accent colours of the UI (`LightColor`, `DarkColor`).
