# Config

## Configuration

All settings are in `shared/config.lua`.

### Core

#### Debug

```lua
Config.Debug = true
```

#### Locale

```lua
Config.Locale = 'en' -- 'en' or 'hr'
```

#### Framework

```lua
Config.Framework = 'auto' -- 'auto' | 'esx' | 'qb'
```

#### Target provider

```lua
Config.Target = 'auto'
-- 'auto' auto-detects: ox_target -> qb-target -> qtarget
-- You can force: 'ox', 'qb-target', 'qtarget', or disable with 'none'
```

#### Notification provider

```lua
Config.Notification = { provider = 'okok' } -- 'ox' | 'esx' | 'qb' | 'okok' | 'brutal'
```

#### Keys provider

```lua
Config.Keys = { provider = 'wasabi' } -- 'wasabi' | 'qb' | 'qs' | 'brutal' | 'none'
```

#### Fuel provider

```lua
Config.Fuel = {
  provider = 'okokgasstations' -- 'okokgasstations' | 'legacyfuel' | 'qb-fuel' | 'native'
}
```

### Database mapping

```lua
Config.DB = {
  esx_table = 'owned_vehicles',
  qb_table  = 'player_vehicles',
  col_state   = 'garage_state',
  col_garage  = 'garage_id',
  col_updated = 'garage_updated',

  -- optional (only used if columns exist):
  -- col_fuel   = 'garage_fuel',
  -- col_engine = 'garage_engine',
  -- col_body   = 'garage_body',

  docs_table = '3m_garage_vehicle_docs'
}
```

> The script **detects column existence** and will use `garage_fuel/garage_engine/garage_body` if present.

### Security

```lua
Config.Security = {
  InteractDistance = 8.0,
  ActionCooldownMs = 1200,
  PlateLockMs = 8000,
}
```

* **InteractDistance**: max distance for server validations (spawn/store/docs)
* **ActionCooldownMs**: prevents spam clicking
* **PlateLockMs**: plate-level lock to avoid double actions on the same plate

### Transfer

```lua
Config.Transfer = {
  enabled = true,
  Fee = 500,
  PayAccount = 'bank'
}
```

### Impound fee

```lua
Config.Impound = {
  Fee = 750,
  PayAccount = 'bank',
}
```

### Docs system

```lua
Config.Docs = {
  enabled = true,

  -- Docs UI + printing only in public garages
  publicOnly = true,

  registration = {
    days = 7,
    price = 2500,
    payAccount = 'bank',
  },

  insurance = {
    days = 7,
    price = 2000,
    payAccount = 'bank',
  },

  printFee = 100,
  printPayAccount = 'cash',

  paperItem = 'vehicle_papers',

  -- On transfer: reset holder + dates + token, keep VIN
  resetOnTransfer = true,
}
```

#### Notes

* Printing generates a **new token** each time. Old paper items become invalid.
* To use papers as an item, inventory metadata support is strongly recommended.

### Garages

`Config.Garages` is a list of entries. Each entry supports:

* `id`, `label`, `type` (`public` or `job`)
* `blip` settings
* `npc` (model + coords)
* `spawns` list

#### Public example

```lua
{
  id = 'pillbox',
  label = 'Pillbox Garage',
  type = 'public',
  blip = { enabled = true, sprite = 357, color = 3, scale = 0.85 },
  npc = { model = `s_m_m_autoshop_02`, coords = vec4(215.06, -810.55, 30.73, 158.0) },
  spawns = {
    vec4(229.40, -802.94, 30.57, 157.0),
    vec4(232.05, -801.87, 30.56, 157.0),
  },
}
```

#### Job garage (fleet) example

```lua
{
  id = 'lspd_motorpool',
  label = 'LSPD Motorpool',
  type = 'job',
  job  = 'police',
  company = 'Los Santos Police Department',
  orgFuelPct = 85, -- spawned fleet fuel (percent)

  fleet = {
    sultan  = 3,
    police3 = 2,
    burrito = 1,
  },

  blip = { enabled = true, sprite = 357, color = 29, scale = 0.85 },
  npc = { model = `s_m_y_cop_01`, coords = vec4(450.12, -1024.55, 28.65, 90.0) },
  spawns = {
    vec4(440.21, -1021.33, 28.55, 90.0),
  },
}
```

### Impounds

```lua
Config.Impounds = {
  {
    id = 'city_impound',
    label = 'City Impound',
    blip = { enabled = true, sprite = 67, color = 1, scale = 0.9 },
    npc = { model = `s_m_y_cop_01`, coords = vec4(408.92, -1625.28, 29.29, 229.0) },
    spawns = {
      vec4(401.31, -1631.89, 29.29, 229.0),
    },
  },
}
```
