Progress
ProgressBar
Displays a running progress bar.
lib.progressBar(data)
exports['prism_uipack']:ProgressBar(data)
- duration:
number - label:
string - variant?:
primary|secondary
Default:
primary
- position?:
top-center|bottom-center|right-center|left-center|bottom|center|middle
Default:
bottom-center
- useWhileDead?:
boolean - allowRagdoll?:
boolean - allowSwimming?:
boolean - allowCuffed?:
boolean - allowFalling?:
boolean - canCancel?:
boolean - anim?:
table(object)
- dict?:
stringMust specify either scenario or dict
- clip:
string- flag?:
numberDefault:
49
- blendIn?:
floatDefault:
3.0
- blendOut?:
floatDefault:
1.0
- duration?:
numberDefault:
-1
- playbackRate?:
numberDefault:
0
- blendOut?:
floatDefault:
1.0
- duration?:
numberDefault:
-1
- playbackRate?:
numberDefault:
0
- lockX?:
boolean- lockY?:
boolean- lockZ?:
boolean- scenario?:
stringMust specify either scenario or dict
- playEnter?:
booleanDefault:
true
- prop?:
table|(object or array)
- [ If you want to define multiple props, you can pass them as individual tables (array of objects) ]
- model:
hash- bone?:
numberDefault:
60309
- pos:
tablex:
numbery:numberz:number
- rot:
table(object)x:
numbery:numberz:number
- rotOrder?:
numberThe order in which yaw, pitch and roll is applied. Default:
0
- disable?:
table(object)
- move?:
boolean- car?:
boolean- combat?:
boolean- mouse?:
boolean- sprint?:
boolean
ProgressActive
Returns true if a progress bar is currently active.
lib.progressActive()
exports['prism_uipack']:ProgressActive()CancelProgress
If there is a progress bar active and the progress bar can be cancelled then it cancels it.
lib.cancelProgress()
exports['prism_uipack']:CancelProgress()Example
ox_lib
-- Primary
if lib.progressBar({
label = 'Smoking a Cigarette',
duration = 5000,
position = 'bottom-center',
anim = {
scenario = 'WORLD_HUMAN_SMOKING'
},
canCancel = true
}) then
print('Do stuff when complete')
else
print('Do stuff when cancelled')
end
-- Secondary
if lib.progressBar({
label = 'Smoking a Cigarette',
duration = 5000,
variant = 'secondary',
position = 'bottom-center',
anim = {
scenario = 'WORLD_HUMAN_SMOKING'
},
canCancel = true
}) then
print('Do stuff when complete')
else
print('Do stuff when cancelled')
endexports
-- Primary
if exports['prism_uipack']:ProgressBar({
label = 'Smoking a Cigarette',
duration = 5000,
position = 'bottom-center',
anim = {
scenario = 'WORLD_HUMAN_SMOKING'
},
canCancel = true
}) then
print('Do stuff when complete')
else
print('Do stuff when cancelled')
end
-- Secondary
if exports['prism_uipack']:ProgressBar({
label = 'Smoking a Cigarette',
duration = 5000,
mode = 'secondary',
position = 'bottom-center',
anim = {
scenario = 'WORLD_HUMAN_SMOKING'
},
canCancel = true
}) then
print('Do stuff when complete')
else
print('Do stuff when cancelled')
end

Last updated on