Support table/list of groups when registering commands (#616)

* Support table/list of groups when registering commands

* Adhere to "unwritten code standard"
This commit is contained in:
Vegard Bendiktsen
2020-04-03 09:20:58 +02:00
committed by GitHub
parent 6c70abd5e8
commit f4558c85e3
+7 -1
View File
@@ -138,7 +138,13 @@ ESX.RegisterCommand = function(name, group, cb, allowConsole, suggestion)
end
end, true)
ExecuteCommand(('add_ace group.%s command.%s allow'):format(group, name))
if type(group) == 'table' then
for k,v in ipairs(group) do
ExecuteCommand(('add_ace group.%s command.%s allow'):format(v, name))
end
else
ExecuteCommand(('add_ace group.%s command.%s allow'):format(group, name))
end
end
ESX.ClearTimeout = function(id)