From f4558c85e3e313b7cefba351c1e459418fe38718 Mon Sep 17 00:00:00 2001 From: Vegard Bendiktsen Date: Fri, 3 Apr 2020 09:20:58 +0200 Subject: [PATCH] Support table/list of groups when registering commands (#616) * Support table/list of groups when registering commands * Adhere to "unwritten code standard" --- server/functions.lua | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/server/functions.lua b/server/functions.lua index 74e2efcc..601f27f0 100644 --- a/server/functions.lua +++ b/server/functions.lua @@ -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)