fix stop do not use resources

This commit is contained in:
Arctos2win
2023-09-17 15:59:43 +02:00
committed by GitHub
parent 5ff044c791
commit a6b58866f8
+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()
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)