> 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/catalogue.md).

# Catalogue

Both live in `catalog.lua`. `Catalog.Categories` are the groups a dealership can show, `Catalog.Vehicles` holds one list per dealership id out of `config.lua`.

### Your own categories

A category is one line: an id you pick and the label the panel shows. Put that id under a dealership's `categories` and on the vehicles that belong in it. The order in the list is the order the arrows in the panel walk through, and one dealership can show as many as you want.

```lua
Catalog.Categories = {
    { id = 'compacts', label = 'Compacts' },
    { id = 'tuner',    label = 'Tuner' },
}
```

### A vehicle line

```lua
Catalog.Vehicles = {
    car = {
        { model = 'blista', price = 15000, category = 'compacts', type = 'automobile' },
        { model = 'sultan', price = 42000, category = 'tuner', type = 'automobile',
          job = 'mechanic', jobGrade = 2 },
    },
}
```

| Key               | What it is                                                 |
| ----------------- | ---------------------------------------------------------- |
| `model`           | The spawn name of the vehicle                              |
| `price`           | What it costs                                              |
| `category`        | The category id it shows up under                          |
| `type`            | What is written into `owned_vehicles.type` for your garage |
| `label`           | Optional display name, otherwise the game name is used     |
| `job`, `jobGrade` | Optional buy gate, only that job may buy it                |
| `sellPercent`     | Optional, what this one pays back when it is sold          |

### Vehicle types for your garage

Garages sort by the `type` column in `owned_vehicles`, and no two garage scripts word it the same way. That is why it stands on every vehicle, right next to the price.

ESX Legacy itself writes `automobile`, `bike`, `boat`, `heli` and `plane`. Older setups want `car`, and some garages only tell land, air and water apart. Write what yours reads.

If a whole dealership is one type anyway, put `vehicleType` on the dealership and leave it off its vehicles. `Config.DefaultVehicleType` catches everything that still says nothing.

### Addon vehicles

An addon car is one more line, the same as any other. If it does not spawn, the model is not streamed on your server. The startup check prints every model the game does not know, which is where you see it first.
