mirror of
https://github.com/esx-framework/esx_core.git
synced 2026-09-04 16:23:21 +00:00
Only grant ace permission if needed (even if fivem devs changed the behaviour)
This commit is contained in:
+6
-2
@@ -1,8 +1,7 @@
|
||||
Citizen.CreateThread(function()
|
||||
SetMapName('San Andreas')
|
||||
SetGameType('Roleplay')
|
||||
local resourcesStopped = {}
|
||||
ExecuteCommand('add_ace resource.es_extended command.stop allow')
|
||||
local resourcesStopped, isAceGranted = {}, false
|
||||
|
||||
for resourceName,reason in pairs(Config.IncompatibleResourcesToStop) do
|
||||
local status = GetResourceState(resourceName)
|
||||
@@ -12,6 +11,11 @@ Citizen.CreateThread(function()
|
||||
Citizen.Wait(100)
|
||||
end
|
||||
|
||||
if not isAceGranted then
|
||||
ExecuteCommand('add_ace resource.es_extended command.stop allow')
|
||||
isAceGranted = true
|
||||
end
|
||||
|
||||
ExecuteCommand(('stop %s'):format(resourceName))
|
||||
resourcesStopped[resourceName] = reason
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user