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

# Configuration

Everything a server owner touches sits in `config.lua`, `catalog.lua`, `server_config.lua`, the two locale files and `html/style.css`.

### Basics

| Setting               | What it does                                             |
| --------------------- | -------------------------------------------------------- |
| `Config.Locale`       | Language, `en` or `de`                                   |
| `Config.Currency`     | The currency symbol in the panel                         |
| `Config.StartupCheck` | Checks the config on start and prints what looks wrong   |
| `Config.Payment`      | What a car can be paid with, and what the panel picks    |
| `Config.PlateFormat`  | The plate a bought car gets, 1 is a digit and A a letter |
| `Config.BuyCooldown`  | Shortest time in ms between two purchases of a player    |

A single dealership can carry its own `payment` table with the same three keys.

### Delivery

`Config.Delivery` decides what happens right after a purchase.

* `spawn` puts the car down at the location's delivery point and seats the buyer in it.
* `garage` spawns nothing and saves the car as parked, so the buyer takes it out at their garage.

Before the money is taken it is checked whether another car already stands on the delivery point. `Config.DeliveryCheck` is the radius in metres, 0 turns the check off, and `Config.DeliveryBlocked` decides what happens then: `refuse` stops the purchase and pays nothing, `garage` lets the sale go through and parks the car instead.

`Config.WriteOwnedVehicles` writes bought cars into the ESX `owned_vehicles` table. Set it to false only if your garage keeps its own table and you wired that up in `server/garage.lua`.

### Paint

`Config.Paint.colors` is a plain list of names and hex values. The showroom car repaints while the customer clicks through them, and the car keeps that paint after the purchase. The panel shows ten swatches per row, so a list of 10, 20 or 30 colours fills its last row exactly. `Config.Paint.enabled = false` sells every car in its default paint.

### Test drive

```lua
Config.TestDrive = {
    enabled  = true,
    duration = 60,
    fee      = 0,
    account  = 'cash',
    returnToShop = true,
    radius   = 0,
}
```

The car spawns at the location's `testdrive` point. X or getting out ends the drive early, and the panel comes back exactly as it was, with the same car, category, paint and payment method still selected. `radius` is how far from the dealership the driver may go, 0 means no limit. A single dealership turns test drives off with `testdrive = false`.

### Discounts

Price cuts for a job or an ESX group. The best matching rule wins, nothing stacks, and a rule with neither job nor group applies to everybody. The panel shows the reduced price, and the server works it out again by itself for every purchase.

```lua
Config.Discounts = {
    enabled = true,
    rules   = {
        { group = 'vip', percent = 10 },
        { job = 'police', jobGrade = 2, percent = 15 },
    },
}
```

{% hint style="warning" %}
The startup check warns when a high discount meets a high sell back percentage, because that combination lets a player buy cheap and sell at a profit.
{% endhint %}

### Custom plates

`Config.CustomPlate` lets the buyer type their own plate. The fee is added to the price and paid the same way, letters, numbers and spaces only, and the plate has to be free.

### Colours and your server name

`html/style.css` holds every colour of the interface plus the small line above the panel title. Change a value, restart the resource, done, no rebuild needed. Put your server name into `--brand-text`, keeping the quotes, or set it to `""` to hide that line.

### Discord logs

`server_config.lua` takes three webhooks: `buy`, `sell` and `contract`, each with its own embed colour. Put the same URL everywhere for one channel, or leave one empty to skip that event.
