diff --git a/client/functions.lua b/client/functions.lua index c5f3b80..6364c36 100644 --- a/client/functions.lua +++ b/client/functions.lua @@ -9,18 +9,20 @@ function progressbar(text, time, anim) TriggerEvent('animations:client:EmoteCommandStart', {anim}) if progressbartype == 'oxbar' then if lib.progressBar({ duration = time, label = text, useWhileDead = false, canCancel = true, disable = { car = true, move = true},}) then - TriggerEvent('animations:client:EmoteCommandStart', {"c"}) if GetResourceState('scully_emotemenu') == 'started' then exports.scully_emotemenu:cancelEmote() + else + TriggerEvent('animations:client:EmoteCommandStart', {"c"}) end return true end elseif progressbartype == 'oxcir' then if lib.progressCircle({ duration = time, label = text, useWhileDead = false, canCancel = true, position = 'bottom', disable = { car = true,move = true},}) then - TriggerEvent('animations:client:EmoteCommandStart', {"c"}) if GetResourceState('scully_emotemenu') == 'started' then exports.scully_emotemenu:cancelEmote() - end + else + TriggerEvent('animations:client:EmoteCommandStart', {"c"}) + end return true end elseif progressbartype == 'qb' then @@ -29,14 +31,17 @@ function progressbar(text, time, anim) QBCore.Functions.Progressbar("drink_something", text, time, false, true, { disableMovement = true, disableCarMovement = true, disableMouse = false, disableCombat = true, disableInventory = true, }, {}, {}, {}, function()-- Done test = true - TriggerEvent('animations:client:EmoteCommandStart', {"c"}) if GetResourceState('scully_emotemenu') == 'started' then exports.scully_emotemenu:cancelEmote() + else + TriggerEvent('animations:client:EmoteCommandStart', {"c"}) end end, function() cancelled = true if GetResourceState('scully_emotemenu') == 'started' then exports.scully_emotemenu:cancelEmote() + else + TriggerEvent('animations:client:EmoteCommandStart', {"c"}) end end) repeat