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

# Configuration

### Basics

```lua
Config.Locale = 'en'
Config.VersionCheck = true
Config.OpenKey = 'M'
Config.RefreshMs = 250
```

| Option                | Description                                                               |
| --------------------- | ------------------------------------------------------------------------- |
| `Config.Locale`       | Language of all texts, `'en'` or `'de'`                                   |
| `Config.VersionCheck` | Prints a note in the server console when a newer version is out           |
| `Config.OpenKey`      | Default key for the menu, rebindable by every player                      |
| `Config.RefreshMs`    | How often the open menu refreshes vehicle and seat state, in milliseconds |

### Closing with a game control

```lua
Config.ControlClose = {
    enabled = true,
    control = 200
}
```

Closes the open menu with a fixed game control. 200 is ESC. Set `enabled = false` to turn it off, or put any other [FiveM control id](https://docs.fivem.net/docs/game-references/controls/) in `control`. This one is not rebindable per player.

### Engine key bind

```lua
Config.EngineKeybind = {
    enabled = true,
    key = 'G'
}
```

An extra key that toggles the engine without opening the menu. It only works in the driver seat. `enabled = false` removes the key bind completely, it does not even show up in the FiveM key binding settings then. The key is the default and stays rebindable per player.

### Features

```lua
Config.Features = {
    engine = true,
    lights = true,
    indicators = true,
    doors = true,
    windows = true,
    roof = true,
    gear = true,
    anchor = true,
    neon = true,
    seats = true,
    status = true
}
```

Turns single features on or off. A disabled feature disappears from the menu for everyone and its actions are refused server side as well.

| Key          | Buttons it controls                                                                                     |
| ------------ | ------------------------------------------------------------------------------------------------------- |
| `engine`     | Engine on and off                                                                                       |
| `lights`     | Permanent light button, see below                                                                       |
| `indicators` | Left, right and hazard                                                                                  |
| `doors`      | Doors, hood and trunk                                                                                   |
| `windows`    | Roll each window up and down                                                                            |
| `roof`       | Convertible roof, only shows on convertibles                                                            |
| `gear`       | Landing gear on planes and helicopters                                                                  |
| `anchor`     | Boat anchor                                                                                             |
| `neon`       | Underglow on and off, only on vehicles that have neon installed                                         |
| `seats`      | Seat switching, also decides if passengers may open the menu at all and whether the seat commands exist |
| `status`     | Fuel and engine condition chips in the panel                                                            |

A common case is `engine = false` when another resource owns the engine, for example a vehicle key script.

{% hint style="info" %}
Buttons only show for hardware the vehicle actually has. Bicycles show the seats only, a car without a trunk gets no trunk button, and a window button appears only where the model really has a window, so a van does not get one for its cargo doors. How strict that window check is, and which vehicle classes are excluded, is up to you in `Config.Windows` below.
{% endhint %}

### Lights

The light button is a permanent light switch, not a normal light switch.

| State | What happens                                                                                                                        |
| ----- | ----------------------------------------------------------------------------------------------------------------------------------- |
| On    | The headlights are forced on and stay lit, also after the driver gets out of the vehicle                                            |
| Off   | The lights are handed back to the game, so the normal headlight key of the player works again and the lights go out with the engine |

Switching the button off does not force the lights off, it releases them. That is what keeps the player in control of the normal lights, and it is why the LED under the button only lights up for the permanent light, not for headlights a player turned on themselves. The forced light is always low beam.

### Indicators

```lua
Config.IndicatorAutoOff = true
```

Turns a left or right indicator off automatically once the turn is finished, like a real car. Hazard lights are never cancelled automatically.

Indicators and windows are synced to every player, and they keep running after the menu is closed.

### Windows

```lua
Config.Windows = {
    requireBone = true,
    blockedClasses = { 8, 13, 14, 15, 16, 21 }
}
```

A window button always needs the matching door on the vehicle. These two settings decide what happens on top of that, so you pick how strict the detection is.

| Option           | Description                                                                                                                                                                                                           |
| ---------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `requireBone`    | `true` shows a window only when the vehicle model carries the matching window bone, which is what keeps vans and trucks from offering windows for their cargo doors. `false` gives every valid door its window button |
| `blockedClasses` | Vehicle classes that never get window buttons, even when the model has the bones. Default: motorcycles, cycles, boats, helicopters, planes and trains                                                                 |

The class ids are the normal FiveM vehicle classes: 0 compacts, 1 sedans, 2 SUVs, 3 coupes, 4 muscle, 5 sports classics, 6 sports, 7 super, 8 motorcycles, 9 off-road, 10 industrial, 11 utility, 12 vans, 13 cycles, 14 boats, 15 helicopters, 16 planes, 17 service, 18 emergency, 19 military, 20 commercial, 21 trains.

{% hint style="info" %}
Take a class out of the list to allow windows there again. If the planes on your server have side windows that should roll down, remove `16`. An empty table blocks nothing.
{% endhint %}

### Colours

The accent colour of the panel is in `html/style.css`. Change it there, no rebuild needed.
