Fixed Some Bugs

This commit is contained in:
Cooldude2606
2017-08-20 21:01:56 +01:00
parent 8e54a1d8bb
commit 7d02a52e2b
3 changed files with 6 additions and 3 deletions

View File

@@ -81,7 +81,10 @@ 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
local temp_restriction = nil
if type(command.restriction) == 'number' then temp_restriction = command.restriction end
local restriction = temp_restriction or string_to_rank(command.restriction).power or 0
if restriction > string_to_rank(rank).power then table.insert(to_return,command) end
end
return to_return
end