From a6b58866f88757736a410a8124fc16de69629676 Mon Sep 17 00:00:00 2001 From: Arctos2win <116841243+Arctos2win@users.noreply.github.com> Date: Sun, 17 Sep 2023 15:59:43 +0200 Subject: [PATCH 1/2] fix stop do not use resources --- [core]/es_extended/server/main.lua | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/[core]/es_extended/server/main.lua b/[core]/es_extended/server/main.lua index 118b88ed..4dd1dd79 100644 --- a/[core]/es_extended/server/main.lua +++ b/[core]/es_extended/server/main.lua @@ -748,16 +748,20 @@ local DoNotUse = { ['default_spawnpoint'] = true, } +AddEventHandler('onResourceStart', function(key) + if DoNotUse[string.lower(key)] then + while GetResourceState(key) ~= 'started' do + Wait() + end + + StopResource(key) + print(("[^1ERROR^7] WE STOPPED A RESOURCE THAT WILL BREAK ^1ESX^7, PLEASE REMOVE ^5%s^7"):format(key)) + end +end) + for key in pairs(DoNotUse) do if GetResourceState(key) == 'started' or GetResourceState(key) == 'starting' then - StopResource(key) + StopResource(key) print(("[^1ERROR^7] WE STOPPED A RESOURCE THAT WILL BREAK ^1ESX^7, PLEASE REMOVE ^5%s^7"):format(key)) end end - -AddEventHandler('onResourceStart', function(key) - if DoNotUse[string.lower(key)] then - StopResource(key) - print(("[^1ERROR^7] WE STOPPED A RESOURCE THAT WILL BREAK ^1ESX^7, PLEASE REMOVE ^5%s^7"):format(key)) - end -end) From c21294867a01f7585239d5bf37924c3419b54cc5 Mon Sep 17 00:00:00 2001 From: Arctos2win <116841243+Arctos2win@users.noreply.github.com> Date: Sun, 17 Sep 2023 16:38:25 +0200 Subject: [PATCH 2/2] add 0 --- [core]/es_extended/server/main.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/[core]/es_extended/server/main.lua b/[core]/es_extended/server/main.lua index 4dd1dd79..b03092df 100644 --- a/[core]/es_extended/server/main.lua +++ b/[core]/es_extended/server/main.lua @@ -751,7 +751,7 @@ local DoNotUse = { AddEventHandler('onResourceStart', function(key) if DoNotUse[string.lower(key)] then while GetResourceState(key) ~= 'started' do - Wait() + Wait(0) end StopResource(key)