Merge pull request #1212 from Arctos2win/dev

fix stop do not use resources
This commit is contained in:
Gellipapa
2023-09-17 18:22:36 +02:00
committed by GitHub
+12 -8
View File
@@ -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(0)
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)