mirror of
https://github.com/esx-framework/esx_core.git
synced 2026-09-02 19:28:52 +00:00
Merge pull request #537 from Gittified/main
refactor(esx_holdup/client): improved thread sleeping
This commit is contained in:
@@ -37,7 +37,7 @@ end)
|
||||
|
||||
RegisterNetEvent('esx_holdup:tooFar')
|
||||
AddEventHandler('esx_holdup:tooFar', function()
|
||||
holdingUp, store = false, ''
|
||||
store = ''
|
||||
ESX.ShowNotification(TranslateCap('robbery_cancelled'))
|
||||
end)
|
||||
|
||||
@@ -100,12 +100,15 @@ CreateThread(function()
|
||||
end
|
||||
end
|
||||
break
|
||||
else
|
||||
letSleep = true
|
||||
end
|
||||
end
|
||||
if holdingUp then
|
||||
letSleep = false
|
||||
if #(playerPos - Stores[store].position) > Config.MaxDistance then
|
||||
TriggerServerEvent('esx_holdup:tooFar', store)
|
||||
holdingUp, letSleep = false, true
|
||||
end
|
||||
end
|
||||
if letSleep then
|
||||
|
||||
Reference in New Issue
Block a user