Solstice-CyberProgress
This script implements a customizable progress bar system for FiveM with support for animations, props, and user interaction. It provides a cyberpunk-styled UI with various control options
Exports
Progress
exports('Progress', function(data, cb))Parameters
data(table): Configuration options for the progress barname(string): Identifier for the progress actionduration(number): Duration in millisecondslabel(string): Text to display on the progress baruseWhileDead(boolean): Whether the action can be performed while deadcanCancel(boolean): Whether the action can be cancelledcontrolDisables(table): Controls to disable during progressanimation(string|table): Animation to playprop(table|string): Props to attach to the playerpropTwo(table|string): Secondary props to attach
cb(function): Callback function that receives cancelled status
showCyberProgress
exports('showCyberProgress', function(name, label, duration, useWhileDead, canCancel, disableControls, animation, prop, propTwo, onFinish, onCancel))Parameters
name(string): Identifier for the progress actionlabel(string): Display textduration(number): Duration in millisecondsuseWhileDead(boolean): Allow while deadcanCancel(boolean): Allow cancellationdisableControls(table): Control disable configurationanimation(string|table): Animation to playprop(table): Primary prop configurationpropTwo(table): Secondary prop configurationonFinish(function): Success callbackonCancel(function): Cancellation callback
Configuration
Animation List
Pre-configured animations available in Config.AnimationList:
phone: Phone texting animation with phone proptablet: Tablet usage animation with tablet proptype: Typing animationsplice: Wire splicing animationsearch: Searching animation
Control Disable Options
Configure which controls to disable during progress:
{
disableMovement = false,
disableCarMovement = false,
disableMouse = false,
disableCombat = false
}Test Command
Built-in test command configuration:
Config.TestCommand = {
enabled = true,
commandName = 'testbar',
defaultDuration = 5000,
defaultText = "Testing Progress Bar...",
defaultControls = {
disableMovement = true,
disableCarMovement = true,
disableMouse = false,
disableCombat = true
}
}Usage Examples
Basic Progress Bar
exports['Solstice-CyberProgress']:Progress({
name = "basic_action",
duration = 5000,
label = "Processing...",
canCancel = true
}, function(cancelled)
if cancelled then
print("Action cancelled")
else
print("Action completed")
end
end)Progress with Animation
exports['Solstice-CyberProgress']:Progress({
name = "phone_action",
duration = 10000,
label = "Sending Message...",
animation = "phone",
canCancel = true,
controlDisables = {
disableMovement = true,
disableCombat = true
}
}, function(cancelled)
if not cancelled then
-- Action complete logic
end
end)Custom Animation with Props
exports['Solstice-CyberProgress']:Progress({
name = "custom_action",
duration = 8000,
label = "Custom Action",
animation = {
dict = "mini@repair",
anim = "fixing_a_ped"
},
prop = {
model = "prop_tool_wrench",
bone = 60309,
pos = { x = 0.0, y = 0.0, z = 0.0 },
rot = { x = 0.0, y = 0.0, z = 0.0 }
}
}, function(cancelled)
-- Callback logic
end)Using showCyberProgress
exports['Solstice-CyberProgress']:showCyberProgress(
"hack_action",
"Hacking System...",
10000,
false,
true,
{disableMovement = true},
"type",
nil,
nil,
function()
print("Hack completed")
end,
function()
print("Hack cancelled")
end
)QB Intergration
Go to qb-core/client/functions.lua and replace with the one below
function QBCore.Functions.Progressbar(name, label, duration, useWhileDead, canCancel, disableControls, animation, prop, propTwo, onFinish, onCancel)
if GetResourceState('Solstice-CyberProgress') ~= 'started' then error('Solstice-CyberProgress needs to be started in order for QBCore.Functions.Progressbar to work') end
exports['Solstice-CyberProgress']: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)
endUI Customization
The progress bar uses a cyberpunk-styled UI with:
System ID display
Real-time system clock
Progress percentage
Time remaining
Custom frames and corners
Progress markers
The UI can be customized by modifying the HTML and associated CSS styles.
Notes
Animations and props are automatically cleaned up after completion
Resources are properly loaded and unloaded
The script handles resource stops gracefully
Last updated
Was this helpful?