Fix progressbars getting stuck on ox_lib

This commit is contained in:
Jim Shield
2025-06-18 12:02:03 +01:00
parent 3e402cae3d
commit f39678002f

View File

@@ -78,12 +78,21 @@ function progressBar(data)
bone = data.propTwo.bone or 0 bone = data.propTwo.bone or 0
} }
end end
if data.progressType == "circle" then result = exports[OXLibExport]:progressCircle(options) if data.progressType == "circle" then
elseif data.progressType == "bar" then result = exports[OXLibExport]:progressBar(options) if exports[OXLibExport]:progressCircle(options) then
else result = true
result = exports[OXLibExport]:progressBar(options) else
result = false
end
end end
return result if not data.progressType or data.progressType == "bar" then
if exports[OXLibExport]:progressBar(options) then
result = true
else
result = false
end
end
elseif Config.System.ProgressBar == "qb" then elseif Config.System.ProgressBar == "qb" then
Core.Functions.Progressbar("progbar", Core.Functions.Progressbar("progbar",
data.label, data.label,
@@ -200,7 +209,9 @@ function progressBar(data)
inProgress = false inProgress = false
end end
while result == nil do Wait(10) end while result == nil do
Wait(10)
end
-- Cleanup -- Cleanup
FreezeEntityPosition(ped, false) FreezeEntityPosition(ped, false)
@@ -277,7 +288,7 @@ function stopProgressBar()
exports[OXLibExport]:cancelProgress() exports[OXLibExport]:cancelProgress()
elseif Config.System.ProgressBar == "qb" then elseif Config.System.ProgressBar == "qb" then
TriggerEvent("progressbar:client:cancel") TriggerEvent("progressbar:client:cancel")
elseif Config.System.ProgressBar == "gta" then elseif Config.System.ProgressBar == "gta" or Config.System.ProgressBar == "red" then
inProgress = false inProgress = false
end end
end end