This page explains how to integrate the 'Sweepz_Ui_Elements' script's progress bar system into other systems.
File Location: qb-core/client/functions.lua
Line Number: 192
functionQBCore.Functions.Progressbar(name,label,duration,useWhileDead,canCancel,disableControls,animation,prop,propTwo,onFinish,onCancel)ifGetResourceState('Sweepz_Ui_Elements') ~='started' thenerror('Sweepz_Ui_Elements needs to be started in order for QBCore.Functions.Progressbar to work') end exports['Sweepz_Ui_Elements']:Progress({ name = name:lower(), duration = duration, label = label, useWhileDead = useWhileDead, canCancel = canCancel, controlDisables = disableControls, animation = animation, prop = prop, propTwo = propTwo, }, function(cancelled)ifnot cancelled thenif onFinish thenonFinish()endelseif onCancel thenonCancel()endendend)end
File Location: es_extended/client/functions.lua
Line Number: 144
function ESX.Progressbar(message, length, options)
if GetResourceState('Sweepz_Ui_Elements') ~= 'started' then error('Sweepz_Ui_Elements needs to be started in order for QBCore.Functions.Progressbar to work') end
exports['Sweepz_Ui_Elements']:Progress({
name = "esx_progress_"..math.random(1000, 9999),
duration = length,
label = message,
useWhileDead = false,
canCancel = true,
controlDisables = options.FreezePlayer,
animation = options.animation,
prop = {},
propTwo = {},
}, function(cancelled)
if not cancelled then
if options.onFinish then
options.onFinish()
end
else
if options.onCancel then
options.onCancel()
end
end
end)
end
function ESX.CancelProgressbar()
TriggerEvent('progressbar:client:cancel')
end