Client side

General

ToggleHud

---@param bool? Toggle the hud on or off (if not provided, it will toggle the hud)
exports["tgg-hud"]:ToggleHud(bool)

IsSeatbeltOn

---@return bool
exports["tgg-hud"]:IsSeatbeltOn()

ToggleSeatbeltIndicator

--- NOTE: This export only modifies the seatbelt state visually.
--- Used to toggle show/hide the seatbelt indicator and buckle/unbuckle the seatbelt.
--- And modify the buckled seatbelt color.
---@param toggle boolean - Whether to toggle show/hide the seatbelt indicator.
---@param buckle boolean - Whether to buckle/unbuckle the seatbelt.
---@param color string - The color of the buckled seatbelt.
exports["tgg-hud"]:ToggleSeatbeltIndicator(toggle, buckle, color)
Example usage
--- NOTE: This is only a visual change in the UI. It won't add a harness by default.
--- For example, you can create a custom harness using the export method.
--- That way, the buckled seatbelt icon will be red, indicating that 
--- your harness is on.
exports["tgg-hud"]:ToggleSeatbeltIndicator(true, true, "#fd303a" --red)

Progress Bar

StartProgress

local data = {
    label = 'Example', -- The label that will be displayed
    duration = 5000, -- The duration of the progress bar in milliseconds
    canCancel = true, -- If the player can cancel the progress
    useWhileDead = false, -- If the player can use the progress bar while dead
    animation = { -- The animation that will be played
        animDict = 'anim@heists@ornate_bank@hack', -- The animation dictionary
        anim = 'hack_loop', -- The animation name
        flag = 49, -- The animation flag
        scenario = 'PROP_HUMAN_BUM_BIN', -- The scenario that will be played
    },
    prop = { -- The prop that will be displayed
        model = `prop_tgg_computer`, -- The prop model
        bone = 60309, -- The bone id
        coords = { x = 0.0, y = 0.0, z = 0.0 }, -- The prop attachment offset
        rotation = { x = 0.0, y = 0.0, z = 0.0 }, -- The prop attachment rotation
    },
    controlDisables = { -- The controls that will be disabled
        disableMovement = true, -- If the player movement will be disabled
        disableCarMovement = true, -- If the player car movement will be disabled
        disableMouse = false, -- If the player mouse will be disabled
        disableCombat = true, -- If the player combat will be disabled
    },
}
local success = exports['tgg-hud']:StartProgress(data)
if success then
    print('Success')
else
    print('Failed')
end

CancelProgress

exports['tgg-hud']:CancelProgress()

IsProgressActive

---@return boolean
exports['tgg-hud']:IsProgressActive()

Last updated