Solstice-Progress
A feature-rich progress bar system for FiveM with built-in animations, props support, and QBCore compatibility.
Table of Contents
Installation
Usage
Exports
Animation Types
Properties
Examples
Commands
Installation
Add the
Solstice-Progress
folder to your resources directoryAdd
ensure Solstice-Progress
to yourserver.cfg
If using with QBCore, ensure it starts after the QBCore resources
Usage
Basic Usage
exports['Solstice-Progress']:Progress({
name = "unique_name",
duration = 5000,
label = "Processing...",
useWhileDead = false,
canCancel = true,
controlDisables = {
disableMovement = true,
disableCarMovement = true,
disableMouse = false,
disableCombat = true
},
animation = {
dict = "mini@repair",
anim = "fixing_a_player"
},
prop = {
model = "prop_tool_wrench",
bone = 60309,
pos = vector3(0.03, 0.002, -0.0),
rot = vector3(10.0, 160.0, 0.0)
}
}, function(cancelled)
if cancelled then
-- Do something if cancelled
else
-- Do something when completed
end
end)
QBCore Style Usage
exports['Solstice-Progress']:showProgressBar(
"unique_name", -- Name
"Processing...", -- Label
5000, -- Duration
false, -- Use While Dead
true, -- Can Cancel
{ -- Disable Controls
disableMovement = true,
disableCarMovement = true,
disableMouse = false,
disableCombat = true
},
'phone', -- Animation Name
nil, -- Prop
nil, -- Second Prop
function() -- On Finish
print("Completed!")
end,
function() -- On Cancel
print("Cancelled!")
end
)
Exports
Progress
exports['Solstice-Progress']:Progress(data, callback)
ShowTechBar
exports['Solstice-Progress']:showProgressBar(name, label, duration, useWhileDead, canCancel, disableControls, animation, prop, propTwo, onFinish, onCancel)
Properties
Control Disables Object
{
disableMovement = false, -- Disable player movement
disableCarMovement = false, -- Disable vehicle control
disableMouse = false, -- Disable mouse movement
disableCombat = false -- Disable combat actions
}
Animation Object
{
dict = "animation_dictionary", -- Animation dictionary
anim = "animation_name", -- Animation name
flag = 49 -- Animation flag
}
Prop Object
{
model = "prop_model_name", -- Prop model
bone = 60309, -- Attachment bone
pos = vector3(0.0, 0.0, 0.0), -- Position offset
rot = vector3(0.0, 0.0, 0.0) -- Rotation offset
}
Examples
Basic Progress Bar
exports['Solstice-Progress']:Progress({
name = "drinking_water",
duration = 3000,
label = "Drinking Water..."
}, function(cancelled)
if not cancelled then
print("Finished drinking")
end
end)
With Animation
exports['Solstice-Progress']:Progress({
name = "hacking",
duration = 10000,
label = "Hacking System...",
useWhileDead = false,
canCancel = true,
controlDisables = {
disableMovement = true,
disableCombat = true
},
animation = "type"
}, function(cancelled)
if not cancelled then
print("Hack complete")
end
end)
With Custom Animation and Prop
exports['Solstice-Progress']:Progress({
name = "fixing_engine",
duration = 15000,
label = "Repairing Engine...",
useWhileDead = false,
canCancel = true,
controlDisables = {
disableMovement = true,
disableCarMovement = true,
disableCombat = true
},
animation = {
dict = "mini@repair",
anim = "fixing_a_player",
flag = 49
},
prop = {
model = "prop_tool_wrench",
bone = 60309,
pos = vector3(0.03, 0.002, -0.0),
rot = vector3(10.0, 160.0, 0.0)
}
}, function(cancelled)
if cancelled then
print("Repair cancelled")
else
print("Repair complete")
end
end)
Commands
Test Command
/testbar [duration] [text] [animation]
Parameters:
duration: Time in milliseconds (default: 5000)
text: Display text (default: "Testing Progress Bar...")
animation: Animation type (phone, tablet, type, splice, search)
Example:
/testbar 10000 "Testing..." phone
QB Intergration
Replace this in qb-core/client/functions.lua
function QBCore.Functions.Progressbar(name, label, duration, useWhileDead, canCancel, disableControls, animation, prop, propTwo, onFinish, onCancel)
if GetResourceState('Solstice-Progress') ~= 'started' then error('Solstice-Progress needs to be started in order for QBCore.Functions.Progressbar to work') end
exports['Solstice-Progress']:Progress({
name = name:lower(),
duration = duration,
label = label,
useWhileDead = useWhileDead,
canCancel = canCancel,
controlDisables = disableControls,
animation = animation,
prop = prop,
propTwo = propTwo,
}, function(cancelled)
if not cancelled then
if onFinish then
onFinish()
end
else
if onCancel then
onCancel()
end
end
end)
end
Error Handling
The progress bar includes error checking for:
Resource state validation
Animation dictionary loading
Prop model loading
Invalid animation types
Multiple progress bar prevention
If any errors occur, they will be logged to the client console.
Last updated
Was this helpful?