Added some get commands

This commit is contained in:
Cooldude2606
2017-08-20 20:26:06 +01:00
parent 75e3c904f0
commit 3a5c73f0a0
5 changed files with 44 additions and 3 deletions

View File

@@ -76,7 +76,15 @@ function load_command(command)
end
end)
end
-- returns all the commands in a certain rank restriction
function get_commands(rank)
local rank = rank or 'Owner'
local to_return = {}
for _,command in pairs(global.commands) do
if command.restriction <= string_to_rank(restriction).power then table.insert(to_return,command) end
end
return to_return
end
Event.register(-1,function() global.commands = Exp_commands end)
Event.register(defines.events.on_player_joined_game,function() for _,command in pairs(Exp_commands) do load_command(command) end end)
--Please Only Edit Above This Line-----------------------------------------------------------