file-linesExports

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


ToggleHud

Description:

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

Usage:

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

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

Parameters:

  • toggle (boolean)


ShowNotify

Description:

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

Usage:

Parameters:

  • data (table): Data table containing the following keys:

    • icon? (string): The icon of the notification. (use Iconifyarrow-up-right 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:


ShowAnnounce

Description:

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

Usage:

Parameters:

  • data (table): Data table containing the following keys:

    • icon? (string): The icon of the announcement. (use Iconifyarrow-up-right 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:


StartProgress

Description:

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

Usage:

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:

Returns:

  • progress (boolean): true if the progress completed, false if it was canceled.

Example:


ShowProgressUI

Description:

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

Usage:

Parameters:

  • title (string): The text displayed as the progress bar's title.

  • duration (number): The duration of the progress bar in milliseconds.


CancelProgress

Description:

Cancels the currently active progress bar.

Usage:


IsProgressActive

Description:

Checks if a progress bar is currently active.

Usage:

Returns:

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


Last updated