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

# Exports/Events

### Quick Reference

| Export                     | Returns           | Description                    |
| -------------------------- | ----------------- | ------------------------------ |
| `hudIsReady`               | `boolean`         | Is HUD fully loaded            |
| `getHUDVariables`          | `table \| string` | Full HUD data table            |
| `showHUD`                  | —                 | Show HUD                       |
| `hideHUD`                  | —                 | Hide HUD                       |
| `restartHUD`               | —                 | Restart / refresh HUD          |
| `notify`                   | —                 | Show notification              |
| `ToggleSpeedometer`        | —                 | Toggle speedometer             |
| `ToggleTopInformation`     | —                 | Toggle top info bar            |
| `ToggleStatus`             | —                 | Toggle status bars             |
| `ToggleMap`                | —                 | Toggle minimap                 |
| `OpenSettingPanel`         | —                 | Open HUD settings menu         |
| `Progress`                 | —                 | Custom progress bar            |
| `ProgressWithStartEvent`   | —                 | Alias of `Progress`            |
| `ProgressWithTickEvent`    | —                 | Alias of `Progress`            |
| `ProgressWithStartAndTick` | —                 | Alias of `Progress`            |
| `isDoingSomething`         | `boolean`         | Is a progress active (ox\_lib) |
| `GetSeatBeltState`         | `boolean`         | Seatbelt on/off                |
| `SetSeatBeltState`         | —                 | Set/toggle seatbelt            |

### Core

#### `hudIsReady`

Checks if the HUD and NUI are fully initialized.

```lua
local ready = exports['izzy-classichud']:hudIsReady()
if ready then
    -- safe to use other exports
end
```

Returns: `boolean`

#### `getHUDVariables`

Returns the full internal HUD data object.

```lua
local data = exports['izzy-classichud']:getHUDVariables()
```

Returns:

* `table` — full HUD state (`bars`, `speedometer`, `clientInfo`, etc.)
* `'not loaded'` — if HUD is not ready yet

#### `showHUD`

Shows all HUD elements (status, top info, speedometer in vehicle, etc.).

```lua
exports['izzy-classichud']:showHUD()
```

#### `hideHUD`

Hides all HUD elements and the minimap.

```lua
exports['izzy-classichud']:hideHUD()
```

#### `restartHUD`

Hides everything, waits 500ms, then shows HUD again. Useful after UI glitches.

```lua
exports['izzy-classichud']:restartHUD()
```

### Notifications

#### `notify`

Shows an in-HUD notification.

```lua
exports['izzy-classichud']:notify({
    message = 'Action completed!',
    type = 'success', -- success | error | info | warning
    duration = 5000   -- optional, default 5000ms
})
```

Parameters:

| Field      | Type     | Required | Description                           |
| ---------- | -------- | -------- | ------------------------------------- |
| `message`  | `string` | Yes      | Notification text                     |
| `type`     | `string` | No       | `success`, `error`, `info`, `warning` |
| `duration` | `number` | No       | Duration in ms (default: 5000)        |

Server-side alternative (via config):

```lua
Config.Notification('Hello player!', 'info', 5000, source)
-- Triggers: izzy-classichud:client:notify
```

### Toggle Exports

#### `ToggleSpeedometer`

Toggles speedometer visibility on/off.

```lua
exports['izzy-classichud']:ToggleSpeedometer()
```

#### `ToggleTopInformation`

Toggles the top info bar (cash, bank, job, player count, etc.).

```lua
exports['izzy-classichud']:ToggleTopInformation()
```

#### `ToggleStatus`

Toggles status bars (health, armor, hunger, thirst, etc.).

```lua
exports['izzy-classichud']:ToggleStatus()
```

#### `ToggleMap`

Toggles minimap visibility.

```lua
exports['izzy-classichud']:ToggleMap()
```

#### `OpenSettingPanel`

Opens the in-game HUD settings panel with NUI focus.

```lua
exports['izzy-classichud']:OpenSettingPanel()
```

### Progress Bar

\
`Progress`

Runs a custom progress bar with optional animation and control disables.

```lua
exports['izzy-classichud']:Progress({
    duration = 5000,
    label = 'Repairing vehicle...',
    useWhileDead = false,
    canCancel = true,
    controlDisables = {
        disableMovement = false,
        disableCarMovement = false,
        disableMouse = false,
        disableCombat = true,
    },
    animation = {
        animDict = 'mini@repair',
        anim = 'fixing_a_player',
        flags = 49,
    },
}, function(cancelled)
    if not cancelled then
        print('Progress completed')
    else
        print('Progress cancelled')
    end
end)
```

Parameters:

| Field             | Type      | Default           | Description                      |
| ----------------- | --------- | ----------------- | -------------------------------- |
| `duration`        | `number`  | `5000`            | Duration in ms                   |
| `label`           | `string`  | `'Processing...'` | Progress bar text                |
| `canCancel`       | `boolean` | `true`            | Allow cancellation               |
| `controlDisables` | `table`   | `{}`              | Disable controls during progress |
| `animation`       | `table`   | `nil`             | Play animation during progress   |

Cancel progress:

```lua
-- Event
TriggerEvent('izzy-classichud:progressbar:client:cancel')

-- Command (default)
-- /hud_cancel_progress

-- Key (default): X
```

Note: Only one progress can run at a time. If one is already active, a new call is ignored.

\
`ProgressWithStartEvent` / `ProgressWithTickEvent` / `ProgressWithStartAndTick`

Backwards-compatibility aliases — all call `Progress` internally.

```lua
exports['izzy-classichud']:ProgressWithStartEvent(data, callback)
exports['izzy-classichud']:ProgressWithTickEvent(data, callback)
exports['izzy-classichud']:ProgressWithStartAndTick(data, callback)
```

#### `isDoingSomething`

Checks if an ox\_lib progress is currently active.

```lua
local busy = exports['izzy-classichud']:isDoingSomething()
```

### Seatbelt

#### `GetSeatBeltState`

Returns whether the player has their seatbelt on.

```lua
local beltOn = exports['izzy-classichud']:GetSeatBeltState()
```

#### `SetSeatBeltState`

Sets or toggles the seatbelt state.

```lua
-- Toggle
exports['izzy-classichud']:SetSeatBeltState()

-- Force ON
exports['izzy-classichud']:SetSeatBeltState(true)

-- Force OFF
exports['izzy-classichud']:SetSeatBeltState(false)
```

Parameters:

| Param   | Type             | Description                                |
| ------- | ---------------- | ------------------------------------------ |
| `state` | `boolean \| nil` | `true` = on, `false` = off, `nil` = toggle |

Note: Does not work on motorcycles, bicycles, or boats. Disabled when `Config.Seatbelt.enabled = false`.

Alternative event:

```lua
TriggerEvent('seatbelt:client:ToggleSeatbelt')
```

Default key: `B` (`Config.Seatbelt.key`)

### Client Events (Integration)

Events use the `_e()` helper → `{resourceName}:{event}`\
Example: `izzy-classichud:client:notify`

#### HUD visibility & style

```lua
-- Change status bar style (number)
TriggerEvent('izzy-classichud:client:ChangeStatus', 1)

-- Change speedometer style (number)
TriggerEvent('izzy-classichud:client:ChangeSpeedometer', 1)
```

#### Notifications

```lua
-- Client
TriggerEvent('izzy-classichud:client:notify', 'Message', 'success', 5000)

-- Server → Client
TriggerClientEvent('izzy-classichud:client:notify', source, 'Message', 'error', 5000)
```

#### Player data updates (usually triggered by server)

```lua
TriggerClientEvent('izzy-classichud:client:updatePlayerRPName', source, id, name)
TriggerClientEvent('izzy-classichud:client:updatePlayerMoney', source, cash, bank)
TriggerClientEvent('izzy-classichud:client:updatePlayerJob', source, jobLabel, gradeLabel)
TriggerClientEvent('izzy-classichud:client:updatePlayerCount', source, playerCount, maxPlayers)
```

#### Stress (requires `Config.Features.stress.enabled = true`)

```lua
TriggerEvent('hud:client:GainStress', 5)
TriggerEvent('hud:client:RelieveStress', 3)
TriggerEvent('hud:client:UpdateStress', 50)
```

#### Needs (QB / bridge)

```lua
TriggerEvent('hud:client:UpdateNeeds', hunger, thirst)
```

### Practical Examples

#### Hide HUD during a cutscene

```lua
exports['izzy-classichud']:hideHUD()
-- cutscene...
exports['izzy-classichud']:showHUD()
```

#### Custom script notification

```lua
exports['izzy-classichud']:notify({
    message = 'You received $500',
    type = 'success',
    duration = 3000
})
```

#### Check seatbelt before action

```lua
if not exports['izzy-classichud']:GetSeatBeltState() then
    exports['izzy-classichud']:notify({
        message = 'Put your seatbelt on!',
        type = 'warning'
    })
    return
end
```

#### Progress bar in a job script

```lua
exports['izzy-classichud']:Progress({
    duration = 8000,
    label = 'Collecting items...',
    canCancel = true,
    controlDisables = {
        disableMovement = true,
        disableCombat = true,
    },
}, function(cancelled)
    if not cancelled then
        TriggerServerEvent('myjob:server:giveReward')
    end
end)
```

#### Open HUD settings from admin menu

```lua
exports['izzy-classichud']:OpenSettingPanel()
```

### Dependencies

| Dependency                             | Required                 |
| -------------------------------------- | ------------------------ |
| `ox_lib`                               | Yes                      |
| `qb-core` or `es_extended`             | Yes (one of)             |
| `pma-voice` / `saltychat` / `tokovoip` | Optional (voice)         |
| Fuel script                            | Optional (auto-detected) |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://izzyshop-1.gitbook.io/izzyshop-docs/hud-resources/classic-hud/exports-events.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
