Page cover

Events / Export List

All of these events and exports are client-sided

/hud

Opens the HUD customisation menu.

Hide / Show the HUD UI

Show or hide the HUD itself, based on the isOpenvariable.

TriggerEvent("cdw-hud:setHudOpen", isOpen)

Notify

exports["cdw-hud"]:notify(text, texttype, length)
Parameter
Type
Description

text

String

The notification text to display

texttype

String

"primary" | "warning" | "success" | "error"

length

Integer

Time the notificaiton will show on screen in miliseconds

Example Usage

exports["cdw-hud"]:notify("Success Notification", "success", 2500)
exports["cdw-hud"]:notify("Warning Notification", "warning", 2500)
exports["cdw-hud"]:notify("Normal Notification", "primary", 2500)
exports["cdw-hud"]:notify("Error Notification", "error", 2500)

Progressbar

Usage

You can use it with either a callback (cb) or by returning the result.

local actions = {
    name = "p_1", -- Unique name for the action
    duration = 2500, -- Duration of the action in milliseconds
    label = "Eating...", -- Text displayed on the progress bar
    icon = "burger" -- Icon that will show up on the progress bar, use Free FontAwesome Icons
    useWhileDead = useWhileDead, -- Can the action be used while dead? (Boolean or null)
    canCancel = canCancel, -- Can the action be canceled? (Boolean or null)
    controlDisables = { -- Table specifying control restrictions
        car = false, -- Block vehicle-related actions? (Boolean or null)
        move = false, -- Prevent character movement? (Boolean or null)
        combat = true, -- Prevent combat actions like punching, aiming, shooting? (Boolean or null)
        mouse = false, -- Prevent mouse movement and camera rotation? (Boolean or null)
        disableRun = true, -- Restrict the player to walking only? (Boolean or null)
    },
    animation = { -- Table for specifying the animation details
        animDict = "veh@van@ds@base", -- Animation dictionary name (String or null)
        anim = "hotwire", -- Animation name (String or null)
        flags = "16", -- Animation flag (String or null)
    },
    prop = { -- Table for attaching the first prop to an entity
        model = "tablet_01", -- Model or hash for the prop (String or number, or null)
        bone = 2108, -- Bone ID where the prop will be attached (Integer or null)
        coords = { x = 0.0, y = 0.0, z = 0.0 }, -- Axis offset for the prop's position (Table or null)
        rotation = { x = 0.0, y = 0.0, z = 0.0 }, -- Rotation of the prop (Table or null)
    },
    propTwo = { -- Table for attaching a second prop to an entity (same structure as prop)
        model = "tablet_01", -- Model or hash for the prop (String or number, or null)
        bone = 2108, -- Bone ID (Integer or null)
        coords = { x = 0.0, y = 0.0, z = 0.0 }, -- Axis offset for position (Table or null)
        rotation = { x = 0.0, y = 0.0, z = 0.0 }, -- Rotation of the prop (Table or null)
    }
}

-- Progress Bar Call: Starts the progress action and handles cancellation
exports["cdw-hud"]:Progress(actions, function(canceled)
    -- Coroutine for handling the progress bar result
end)

-- Return Progress Method: Returns a boolean indicating success or failure
local success = exports["cdw-hud"]:Progress(actions)// Some code

Is Progressbar Active

Returns whether there is an active progressbar.

exports["cdw-hud"]:isActive()

Cancel Progress

Cancels the current progressbar if active.

exports["cdw-hud"]:cancelProgress()

Seatbelt

Returns whether the player is wearing their seatbelt. This only works with the built-in belt system.

exports["cdw-hud"]:Seatbelt()

Last updated