# Configuration (/docs/orbit-studios-resources/orbit-dynamichud-addons/configuration)



# Configuration [#configuration]

All public configuration lives in `resources/[orbit]/orbit-dynamichud-addons/config.lua`.

This resource is client-heavy. Most settings affect how the local player toggles seatbelt or cruise control, what DynamicHUD receives through state bags, and when GTA's windscreen ejection behavior is allowed.

<TypeTable
  type="{
  'Config.Cruise.enable': {
    type: 'boolean',
    default: 'true',
    description: 'Enables or disables cruise control.',
  },
  'Config.Cruise.keybind': {
    type: 'string',
    default: '&#x22;Y&#x22;',
    description: 'Default keyboard keybind for toggling cruise control.',
  },
  'Config.Seatbelt.enable': {
    type: 'boolean',
    default: 'true',
    description: 'Enables or disables the seatbelt system.',
  },
  'Config.Seatbelt.keybind': {
    type: 'string',
    default: '&#x22;B&#x22;',
    description: 'Default keyboard keybind for toggling the seatbelt.',
  },
  'Config.Seatbelt.useMPH': {
    type: 'boolean',
    default: 'false',
    description: 'Uses MPH thresholds instead of KMH thresholds.',
  },
  'Config.Notify': {
    type: 'function(message, type)',
    description: 'Client-side notification bridge. The default triggers orbit-dynamichud:notify.',
  },
}"
/>

<Tabs items="['Seatbelt', 'Cruise', 'Notification']">
  <Tab value="Seatbelt">
    ```lua title="resources/[orbit]/orbit-dynamichud-addons/config.lua"
    Config.Seatbelt = {
        enable = true,
        keybind = 'B',
        useMPH = false,
        minSpeedUnbuckled = 20.0,
        minSpeedBuckled = 160.0,
        harness = {
            disableFlyingThroughWindscreen = true,
            minSpeed = 200.0
        }
    }
    ```

    `useMPH` changes how `minSpeedUnbuckled`, `minSpeedBuckled`, and harness speed values are interpreted. Set it to `true` only when you want those thresholds written as miles per hour.

    `harness.disableFlyingThroughWindscreen = true` prevents windscreen ejection while a harness is active. If you set it to `false`, `harness.minSpeed` becomes the ejection threshold while harnessed.
  </Tab>

  <Tab value="Cruise">
    ```lua title="resources/[orbit]/orbit-dynamichud-addons/config.lua"
    Config.Cruise = {
        enable = true,
        keybind = 'Y'
    }
    ```

    Cruise can only enable when the player is driving, the vehicle is moving forward, and the vehicle class is supported by the client script.
  </Tab>

  <Tab value="Notification">
    ```lua title="resources/[orbit]/orbit-dynamichud-addons/config.lua"
    Config.Notify = function(message, type)
        TriggerEvent("orbit-dynamichud:notify", {
            description = message,
            type = type or 'info',
            duration = 3000
        })
    end
    ```

    Replace this function if you do not use DynamicHUD notifications. Keep it client-side and keep the `(message, type)` parameters so the seatbelt and cruise scripts can call it normally.
  </Tab>
</Tabs>

## Locales [#locales]

The addon uses `ox_lib` locales. Set the locale in `server.cfg`, then edit the matching JSON file if you want different labels or messages.

```properties title="server.cfg"
setr ox:locale en
```

```json title="resources/[orbit]/orbit-dynamichud-addons/locales/en.json"
{
  "actions": {
    "toggle_cruise_control": "Toggle Cruise Control"
  },
  "success": {
    "cruise_control_enabled": "Cruise control enabled"
  },
  "error": {
    "cruise_control_disabled": "Cruise control disabled",
    "cruise_control_unavailable": "Cruise control is not available for this vehicle"
  },
  "seatbelt_desc": "Toggle Seatbelt"
}
```
