# Configuration

##

Main configuration file: `shared/config.lua`.

### Core settings

```lua
Config.Locale = 'en'
Config.Notify = 'okok'
Config.Debug = false
Config.WebhookShopPurchase = ''
Config.WebhookItemPurchase = ''
```

* `Config.Locale`: active language (`en` or `hr`, based on existing locale files).
* `Config.Notify`: notification provider (`okok`, `ox`, `qb`, `esx`, or `auto`).
* `Config.Debug`: enables server/client debug logs.
* `Webhook*`: currently defined in config, but not actively used in server logic.

### Vehicle keys

```lua
Config.VehicleKeySystem = 'auto'
```

Possible values:

* `auto` (autodetect)
* `qb-vehiclekeys`
* `wasabi_carlock`

### Economy and pricing

```lua
Config.PercentageToShop = 50
Config.PriceChangeLimit = 35
```

* `PercentageToShop`: percentage of each sale that goes to shop company balance.
* `PriceChangeLimit`: how much the owner can move price from item `buyPrice`.

Limit formula:

* `min = buyPrice * (1 - limit/100)`
* `max = buyPrice * (1 + limit/100)`

### NPC and shop types

```lua
Config.NPCModel = 'mp_m_shopkeep_01'
Config.ShopTypes = { ... }
```

Each type in `Config.ShopTypes` contains:

* `blip`: `sprite`, `color`, `scale`, `label`
* `items`: list of items

Item format:

```lua
{ name = 'item_name', label = 'Item Label', price = 100, buyPrice = 70 }
```

* `price`: default sale price to customers
* `buyPrice`: supplier purchase price and base for owner price limits

### Supplier and delivery

```lua
Config.Suppliers = {
  regular = vec4(...),
  gun = vec4(...),
  it = vec4(...)
}

Config.DeliveryVehicleModel = 'speedo'
Config.DeliveryVehiclePlate = '3MSUP'
```

* `Config.Suppliers`: pickup locations per shop type.
* `DeliveryVehicleModel`: delivery vehicle model.
* `DeliveryVehiclePlate`: delivery vehicle plate.

### Admin permissions

```lua
Config.AdminAce = 'command'
```

Recommendation:

* use a custom ACE (for example `playerShops.admin`) instead of generic `command`
* configure ACE permissions in `server.cfg`

### Framework / inventory / target bridge

The script auto-detects:

* framework: `es_extended`, `qbx_core`, `qb-core`
* inventory: `ox_inventory`, `qb-inventory` (framework fallback)
* target: `ox_target`, `qb-target`
* notification provider: based on `Config.Notify` and running resources

If you use a custom stack, adjust:

* `bridge/framework.lua`
* `bridge/inventory.lua`
* `client/cl_target.lua`
* `shared/notify.lua`

### Localization

Files:

* `Locales/en.lua`
* `Locales/hr.lua`

Enable language:

```lua
Config.Locale = 'hr'
```

To add a new language:

1. duplicate one locale file
2. translate strings
3. add it in `fxmanifest.lua` under `shared_scripts`
4. set `Config.Locale`
