---
description: >-
  In this section, you'll find easy-to-use exports for notifications,
  announcements, progress bars, and more, ensuring seamless integration with
  your existing scripts.
---

# Exports

***

### <mark style="color:blue;">`ToggleHud`</mark>

#### Description:

Toggle the HUD visibility based on the provided boolean, turning it on or off.

#### Usage:

```lua
exports["cloud-hud"]:ToggleHud(toggle)

TriggerEvent("cloud-hud:ToggleHud", source, toggle)
```

#### Parameters:

* **`toggle`** _(boolean)_

***

### <mark style="color:blue;">`ShowNotify`</mark>

#### Description:

Displays a notification with customizable content, type, and duration.

#### Usage:

```lua
exports["cloud-hud"]:ShowNotify(data)

TriggerEvent("cloud-hud:ShowNotify", source, data)
```

#### Parameters:

* **`data`** _(table)_: Data table containing the following keys:
  * **`icon?`** _(string)_: The icon of the notification. (use [Iconify](https://icon-sets.iconify.design) for icons)
    * If not specified, the default icon defined in `sh_config_alerts.lua` will be used.
  * **`title`** _(string)_: The title of the notification.
  * **`description`** _(string)_: The detailed message or description displayed in the notification.
  * **`type`** _(string)_: Specifies the style of the notification.
    * **Available Types:**
      * `"info"`: Informational messages
        * `"success"`: Success messages
        * `"warning"`: Warning messages
        * `"error"`: Error messages
  * **`duration`** _(number):_ The duration (in milliseconds) for which the notification will be displayed.

#### Example:

```lua
-- Client Side
exports["cloud-hud"]:ShowNotify({
    icon = "mdi:info-circle",
    title = "Info",
    description = "This is an informational message.",
    type = "info",
    duration = 5000,
})

-- Server Side
TriggerClientEvent("cloud-hud:ShowNotify", source, {
    icon = "mdi:info-circle",
    title = "Info",
    description = "This is an informational message.",
    type = "info",
    duration = 5000,
})
```

***

### <mark style="color:blue;">`ShowAnnounce`</mark>

#### Description:

Displays an announcement with customizable content, type, and duration.

#### Usage:

```lua
exports["cloud-hud"]:ShowAnnounce(data)

TriggerEvent("cloud-hud:ShowNotify", source, data)
```

#### Parameters:

* **`data`** _(table)_: Data table containing the following keys:
  * **`icon?`** _(string)_: The icon of the announcement. (use [Iconify](https://icon-sets.iconify.design) for icons)
    * If not specified, the default icon defined in `sh_config_alerts.lua` will be used.
  * **`title`** _(string)_: The title of the announcement.
  * **`description`** _(string)_: The detailed message or description displayed in the announcement.
  * **`type`** _(string)_: Specifies the style of the announcement.
    * **Available Types:**
      * `"announce"`: Announcement messages
        * `"info"`: Informational messages
        * `"success"`: Success messages
        * `"warning"`: Warning messages
        * `"error"`: Error messages
  * **`duration`** _(number):_ The duration (in milliseconds) for which the announcement will be displayed.

#### Example:

```lua
-- Client Side
exports["cloud-hud"]:ShowAnnounce({
    icon = "mdi:announcement",
    title = "Announcement",
    description = "This is an important announcement!",
    type = "announce",
    duration = 5000,
})

-- Server Side
TriggerClientEvent("cloud-hud:ShowAnnounce", source, {
    icon = "mdi:announcement",
    title = "Announcement",
    description = "This is an important announcement!",
    type = "announce",
    duration = 5000,
})
```

***

### <mark style="color:blue;">**`StartProgress`**</mark>

#### **Description:**

Starts a progress bar with detailed customization options, including animations, restrictions, and props.

#### **Usage:**

```lua
local progress = exports["cloud-hud"]:StartProgress(data)

TriggerEvent("cloud-hud:StartProgress", source, data)
```

#### **Parameters:**

* **`data`** _(table)_: Data table containing the following keys:
  * **`title`** _(string)_: The text displayed as the progress bar's title.
  * **`duration`** _(number)_: The duration of the progress bar in milliseconds.
  * **`allow?`** _(table)_: Conditions under which the progress bar is allowed to continue:
    * **`whileDead`** _(boolean)_: Allow while the player is dead.
    * **`whileRagdoll`** _(boolean)_: Allow while ragdolling.
    * **`whileFalling`** _(boolean)_: Allow while falling.
    * **`whileSwimming`** _(boolean)_: Allow while swimming.
    * **`whileCuffed`** _(boolean)_: Allow while cuffed.
    * **`cancel`** _(boolean)_: Allow the player to cancel the progress manually.
  * **`disable?`** _(table)_: Actions disabled during the progress:
    * **`move`** _(boolean)_: Disable movement.
    * **`sprint`** _(boolean)_: Disable sprinting.
    * **`combat`** _(boolean)_: Disable combat actions.
    * **`mouse`** _(boolean)_: Disable mouse look controls.
    * **`car`** _(boolean)_: Disable vehicle controls.
  *   **`anim?`** _(table)_: Animation played during the progress bar:

      * **`scenario?`** _(string)_: Scenario name.
        * Either `scenario` or `dict` must be specified.
      * **`playEnter?`** _(boolean)_:  Plays the enter animation.
        * Default: `true`



      * **`dict?`** _(string)_: Animation dictionary.
        * Either `scenario` or `dict` must be specified.
      * **`name`** _(string)_: Animation name.
      * **`blendIn?`** _(float)_: Animation blend in speed.
        * Default: `3.0`
      * **`blendOut?`** _(float)_: Animation blend out speed.
        * Default: `1.0`
      * **`duration?`** _(number)_: Animation duration.
        * Default: `-1`
      * **`flag?`** _(number)_: Animation flag.
        * Default: `49`
      * **`playbackRate?`** _(number)_: Animation playback rate.
        * Default: `0`
      * **`lockX?`** _(boolean)_: Locks the animation on the X-axis.
      * **`lockY?`** _(boolean)_: Locks the animation on the Y-axis.
      * **`lockZ?`** _(boolean)_: Locks the animation on the Z-axis.
  * **`prop?`** _(table)_: Prop attached to the player during the progress bar:
    * **`model`** _(hash)_: Prop model hash.
    * **`bone`** _(number)_: Bone number.
      * Default: `60309`
    * **`pos`** _(vector3)_: Position offset for the prop.
    * **`rot`** _(vector3)_: Rotation offset for the prop.
    * **`rotOrder`** _(number)_: [The order in which yaw, pitch, and roll are applied.](https://docs.fivem.net/natives/?_0xAFBD61CC738D9EB9=)
      * Default: `0`

#### **Returns:**

* **`progress`** _(boolean)_: `true` if the progress completed, `false` if it was canceled.

#### Example:

<pre class="language-lua"><code class="lang-lua">local progress = exports["cloud-hud"]:StartProgress({
    title = "Eating Burger...",
    duration = 3000,
    allow = {
        whileDead = false,
        whileRagdoll = false,
        whileFalling = false,
        whileSwimming = false,
        whileCuffed = false,
        cancel = true,
    },
    disable = {
        move = false,
        sprint = false,
        combat = false,
        mouse = false,
        car = false,
    },
    anim = {
        dict = "mp_player_inteat@burger",
        name = "mp_player_int_eat_burger_fp",
    },
    prop = {
        model = `prop_cs_burger_01`,
        pos = vec3(0.02, 0.02, -0.02),
        rot = vec3(40.0, 0.0, -10.0),
    },
})

if progress then
    exports["cloud-hud"]:ShowNotify({
        title = "Success",
        description = "Progress completed.",
        type = "success",
<strong>        duration = 3000,
</strong>    })
else
    exports["cloud-hud"]:ShowNotify({
        title = "Warning",
        description = "Progress canceled.",
        type = "warning",
        duration = 3000,
    })
end
</code></pre>

***

### <mark style="color:blue;">**`ShowProgressUI`**</mark>

#### **Description:**

Displays the progress bar UI without any additional functionality or restrictions.

#### **Usage:**

```lua
exports["cloud-hud"]:ShowProgressUI(title, duration)

TriggerEvent("cloud-hud:ShowProgressUI", source, title, duration)
```

#### **Parameters:**

* **`title`** _(string)_: The text displayed as the progress bar's title.
* **`duration`** _(number)_: The duration of the progress bar in milliseconds.

***

### <mark style="color:blue;">**`CancelProgress`**</mark>

#### **Description:**

Cancels the currently active progress bar.

#### **Usage:**

```lua
exports["cloud-hud"]:CancelProgress()

TriggerEvent("cloud-hud:CancelProgress", source)
```

***

### <mark style="color:blue;">**`IsProgressActive`**</mark>

#### **Description:**

Checks if a progress bar is currently active.

#### **Usage:**

```lua
local isActive = exports["cloud-hud"]:IsProgressActive()
```

#### **Returns:**

* **`isActive`** _(boolean)_: `true` if a progress bar is active, `false` otherwise.

***
