progressbar
QBCore wraps the progressbar resource with this client function:
QBCore.Functions.Progressbar(
name, label, duration, useWhileDead, canCancel,
disableControls, animation, prop, propTwo, onFinish, onCancel
)QBCore.Functions.Progressbar('repair_panel', 'Repairing panel', 5000, false, true, {
disableMovement = true,
disableCarMovement = true,
disableMouse = false,
disableCombat = true
}, {}, {}, {}, function()
TriggerServerEvent('myrepair:server:complete')
end, function()
QBCore.Functions.Notify('Repair cancelled', 'error')
end)Use a stable lowercase name. Keep rewards and inventory changes in a server event that validates
the playerβs state; completing a client progress bar is not proof that an action is allowed.
Sources: QBCore wrapperΒ and progressbar sourceΒ