st.progressBar / st.progressCircle — Progress Bars (Client)
ProgressProps class
lua
---@class ProgressProps
---@field label? string
---@field duration number Milliseconds
---@field position? 'middle' | 'bottom'
---@field useWhileDead? boolean
---@field allowRagdoll? boolean
---@field allowCuffed? boolean
---@field allowFalling? boolean
---@field allowSwimming? boolean
---@field canCancel? boolean Allow X key to cancel
---@field anim? {
--- dict? string,
--- clip string,
--- flag? number,
--- blendIn? number,
--- blendOut? number,
--- duration? number,
--- playbackRate? number,
--- lockX? boolean,
--- lockY? boolean,
--- lockZ? boolean,
--- scenario? string,
--- playEnter? boolean,
--- }
---@field prop? ProgressPropProps | ProgressPropProps[]
---@field disable? {
--- move? boolean,
--- sprint? boolean,
--- car? boolean,
--- combat? boolean,
--- mouse? boolean,
--- }lua
-- Linear bar (blocks current thread until complete or cancelled)
local success = st.progressBar({
label = 'Arbejder...',
duration = 5000,
canCancel = true,
anim = { dict = 'mini@repair', clip = 'fixing_a_ped', flag = 49 },
disable = { move = true, combat = true },
})
if success then
-- completed
else
-- cancelled or interrupted
end
-- Circle progress
local success = st.progressCircle({
label = 'Behandler...',
duration = 3000,
position = 'middle',
disable = { move = true },
})
-- Cancel from another coroutine
st.cancelProgress()
-- Check if active
if st.progressActive() then ... endExport (for compatibility with rprogress/progressBars):
lua
exports['st_libs']:progressBar(data)