mirror of
https://github.com/esx-framework/esx_core.git
synced 2026-08-31 18:28:52 +00:00
Merge pull request #1212 from Arctos2win/dev
fix stop do not use resources
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user