diff --git a/locale/ExpGaming-Core/ExpGaming - Command Maker.lua b/locale/ExpGaming-Core/ExpGaming - Command Maker.lua index ff3d5304..3d52eb57 100644 --- a/locale/ExpGaming-Core/ExpGaming - Command Maker.lua +++ b/locale/ExpGaming-Core/ExpGaming - Command Maker.lua @@ -66,7 +66,7 @@ function load_command(command) for _,command_d in pairs(Exp_commands) do if event.name == command_d[1] then command_data = command_d break end end if event.player_index then local player = game.players[event.player_index] - if rank_allowed(get_rank(player),command.name) then + if not rank_allowed(get_rank(player),command.name) then player.print('401 - Unauthorized: Access is denied due to invalid credentials') game.write_file('commands.log','\n'..game.tick..' Player: '..player.name..' Failed to use command (Unauthorized): '..command.name..' With args of: '..table.to_string(get_command_args(event,command,true)), true, 0) return diff --git a/locale/ExpGaming-Core/ExpGaming - Rank Control.lua b/locale/ExpGaming-Core/ExpGaming - Rank Control.lua index 8afb648e..50b36be3 100644 --- a/locale/ExpGaming-Core/ExpGaming - Rank Control.lua +++ b/locale/ExpGaming-Core/ExpGaming - Rank Control.lua @@ -40,7 +40,7 @@ function string_to_rank(string) end -- surches the rank for a certain allow command function rank_allowed(rank,is_allowed) - for _,allow in rank.allow do + for _,allow in pairs(rank.allow) do if allow == is_allowed then return true end end return false diff --git a/locale/ExpGaming-Core/ExpGaming - Rank Table.lua b/locale/ExpGaming-Core/ExpGaming - Rank Table.lua index 8c13cce1..890aad05 100644 --- a/locale/ExpGaming-Core/ExpGaming - Rank Table.lua +++ b/locale/ExpGaming-Core/ExpGaming - Rank Table.lua @@ -161,22 +161,25 @@ local ranks = { } -- rank table setup for n,rank in pairs(ranks.ranks) do - local ranks_list = ranks.ranks rank.power = n - if ranks_list[n-1] then - for _,disallow in pairs(ranks_list[n-1].disallow) do + if ranks.ranks[n-1] then + for _,disallow in pairs(ranks.ranks[n-1].disallow) do table.insert(rank.disallow,disallow) end end - if ranks_list[n+1] then - for _,allow in pairs(ranks_list[n+1].allow) do - table.insert(rank.allow,allow) - end - end if rank.time and not ranks.highest_timed_rank then ranks.highest_timed_rank=rank end if rank.time then ranks.lowest_timed_rank=rank end ranks.number_of_ranks=ranks.number_of_ranks+1 end + +for n = #ranks.ranks, 1, -1 do + rank = ranks.ranks[n] + if ranks.ranks[n+1] then + for _,allow in pairs(ranks.ranks[n+1].allow) do + table.insert(rank.allow,allow) + end + end +end -- returns a list off all the ranks, return only one part if given function get_ranks(part) local to_return = {} diff --git a/locale/ExpGaming-Core/ExpGaming - Server Interface.lua b/locale/ExpGaming-Core/ExpGaming - Server Interface.lua index 44056408..4df3d8f5 100644 --- a/locale/ExpGaming-Core/ExpGaming - Server Interface.lua +++ b/locale/ExpGaming-Core/ExpGaming - Server Interface.lua @@ -19,7 +19,7 @@ local credits = {{ local function credit_loop(reg) for _,cred in pairs(reg) do table.insert(credits,cred) end end --Please Only Edit Below This Line----------------------------------------------------------- --this command is just a way or using loadstring from in game while keeping achievements -define_command('server-interface','For use of the highest staff only',{'command',true},'admin',function(player,event,args) +define_command('server-interface','For use of the highest staff only',{'command',true},function(player,event,args) if player == '' then local returned,value = pcall(loadstring(event.parameter)) if type(value) == 'table' then game.write_file('server-interface.log', '\n'..game.tick..' Ran by: Code: '..event.parameter..'\n Returned: '..table.to_string(value), true, 0) print(table.to_string(value))