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

# Configuration

Every option in config.lua.

Everything is in `config.lua`. Restart the resource after a change.

## Colour

```lua
Config.DefaultColor = '#11998ed2'
Config.ForceDefaultColor = false
```

| Option              | Default       | Description                                                            |
| ------------------- | ------------- | ---------------------------------------------------------------------- |
| `DefaultColor`      | `'#11998ed2'` | HUD colour for players who have not picked their own. Hex with alpha.  |
| `ForceDefaultColor` | `false`       | `true` uses the default colour for everyone and ignores saved choices. |

## Settings panel

```lua
Config.Settings = {
    commandName = 'hud',

    optionsVisible = {
        color = true,
        cinematic = true,
        speedUnit = true,
        radarVisibility = true,
        statusTypes = true,
        statusElements = true,
    }
}
```

| Option                           | Default | Description                                                   |
| -------------------------------- | ------- | ------------------------------------------------------------- |
| `commandName`                    | `'hud'` | Command that opens the settings panel (`/hud`).               |
| `optionsVisible.color`           | `true`  | Players can change the HUD colour.                            |
| `optionsVisible.cinematic`       | `true`  | Players can turn on cinematic mode.                           |
| `optionsVisible.speedUnit`       | `true`  | Players can switch between mph and km/h.                      |
| `optionsVisible.radarVisibility` | `true`  | Players can choose when the radar shows.                      |
| `optionsVisible.statusTypes`     | `true`  | Players can pick the status shape: square, circle or hexagon. |
| `optionsVisible.statusElements`  | `true`  | Players can choose which status elements show.                |

Set an option to `false` to hide it from the panel.

## Logo

```lua
Config.Logo = {
    enabled = true,
    style = {
        position = 'absolute',
        top = '5px',
        right = '5px',
        height = '70px',
        width = '70px'
    }
}
```

| Option    | Default   | Description                            |
| --------- | --------- | -------------------------------------- |
| `enabled` | `true`    | Show the server logo.                  |
| `style`   | see above | Position and size of the logo, as CSS. |

## Speedometer

```lua
Config.Speedometer = {
    unit = 'mph',
    radarInCar = true,
    seatbelt = {
        enabled = true,

        keyMappingName = 'seatbelt',
        commandName = 'seatbelt',
        label = 'Seatbelt',
        key = 'K',

        soundVolume = 0.5,

        minSpeedUnbuckled = 50.0,
        minSpeedBuckled = 800.0,
    },
    fuel = {
        enabled = true
    }
}
```

| Option                       | Default      | Description                                                                                    |
| ---------------------------- | ------------ | ---------------------------------------------------------------------------------------------- |
| `unit`                       | `'mph'`      | Default speed unit: `'mph'` or `'kmh'`.                                                        |
| `radarInCar`                 | `true`       | `true` shows the radar only in a vehicle; `false` shows it always.                             |
| `seatbelt.enabled`           | `true`       | Turn seatbelts on or off.                                                                      |
| `seatbelt.keyMappingName`    | `'seatbelt'` | Name of the key mapping. Leave it unless you know why.                                         |
| `seatbelt.commandName`       | `'seatbelt'` | Command behind the key.                                                                        |
| `seatbelt.label`             | `'Seatbelt'` | Name shown in the GTA key bindings.                                                            |
| `seatbelt.key`               | `'K'`        | Default key.                                                                                   |
| `seatbelt.soundVolume`       | `0.5`        | Volume of the buckle sound.                                                                    |
| `seatbelt.minSpeedUnbuckled` | `50.0`       | Speed from which a crash throws an unbuckled player through the windscreen, in the unit above. |
| `seatbelt.minSpeedBuckled`   | `800.0`      | The same with the seatbelt on. The default is high enough to never happen.                     |
| `fuel.enabled`               | `true`       | Show the fuel level on the speedometer.                                                        |

## Notifications

```lua
Config.Notifications = {
    duration = 4000,
    defaultTitle = 'Notification',
    defaultIcon = 'bell'
}
```

| Option         | Default          | Description                                     |
| -------------- | ---------------- | ----------------------------------------------- |
| `duration`     | `4000`           | How long a notification stays, in milliseconds. |
| `defaultTitle` | `'Notification'` | Title used when the export gives none.          |
| `defaultIcon`  | `'bell'`         | Icon used when the export gives none.           |

## Progress bar

```lua
Config.Progress = {
    keyMappingName = 'cancel_progress',
    commandName = 'cancel_progress',
    label = 'Cancel progress',
    key = 'X'
}
```

The command and the key that cancel a running progress bar. Only a progress bar started with `canCancel = true` can be cancelled.

| Option           | Default             | Description                                                       |
| ---------------- | ------------------- | ----------------------------------------------------------------- |
| `commandName`    | `'cancel_progress'` | Command that cancels the progress bar (`/cancel_progress`).       |
| `keyMappingName` | `'cancel_progress'` | Command the key is bound to. Has to be the same as `commandName`. |
| `label`          | `'Cancel progress'` | Name shown in the GTA key bindings.                               |
| `key`            | `'X'`               | Default key.                                                      |

{% hint style="warning" %}
If you rename the command, change `commandName` and `keyMappingName` together. When they differ, the key does nothing.
{% endhint %}

`key` is the default for new players. A player who already joined keeps their own binding until they change it in the GTA settings.
