From 9e698fb6bd0051774baffbd150a41701d7a9c03c Mon Sep 17 00:00:00 2001 From: Cooldude2606 Date: Sat, 5 Jan 2019 13:56:29 +0000 Subject: [PATCH] Another Bug Bash --- modules/ExpGamingAdmin/Ban/control.lua | 2 +- modules/ExpGamingAdmin/ClearInventory/control.lua | 2 +- modules/ExpGamingAdmin/Commands/src/jail.lua | 1 + modules/ExpGamingAdmin/Jail/control.lua | 2 +- modules/ExpGamingAdmin/Kick/control.lua | 2 +- modules/ExpGamingAdmin/Teleport/control.lua | 2 +- modules/ExpGamingAdmin/TempBan/control.lua | 2 +- modules/ExpGamingAdmin/Warnings/control.lua | 6 +++--- modules/ExpGamingAdmin/control.lua | 2 +- modules/ExpGamingCore/Role/control.lua | 2 +- 10 files changed, 12 insertions(+), 11 deletions(-) diff --git a/modules/ExpGamingAdmin/Ban/control.lua b/modules/ExpGamingAdmin/Ban/control.lua index 856c3c05..32bb1085 100644 --- a/modules/ExpGamingAdmin/Ban/control.lua +++ b/modules/ExpGamingAdmin/Ban/control.lua @@ -46,4 +46,4 @@ end Admin.add_action('Ban',Admin.ban) -- Module Return -return ThisModule \ No newline at end of file +return setmetatable(ThisModule,{__call=Admin.ban}) \ No newline at end of file diff --git a/modules/ExpGamingAdmin/ClearInventory/control.lua b/modules/ExpGamingAdmin/ClearInventory/control.lua index 1efd59f9..7b47d37a 100644 --- a/modules/ExpGamingAdmin/ClearInventory/control.lua +++ b/modules/ExpGamingAdmin/ClearInventory/control.lua @@ -55,4 +55,4 @@ end Admin.add_action('Clear Inventory',Admin.move_inventory) -- Module Return -return ThisModule \ No newline at end of file +return setmetatable(ThisModule,{__call=Admin.move_inventory}) \ No newline at end of file diff --git a/modules/ExpGamingAdmin/Commands/src/jail.lua b/modules/ExpGamingAdmin/Commands/src/jail.lua index 7b7bc559..7d60da06 100644 --- a/modules/ExpGamingAdmin/Commands/src/jail.lua +++ b/modules/ExpGamingAdmin/Commands/src/jail.lua @@ -25,5 +25,6 @@ commands.add_command('unjail', 'Returns a player\'s old rank', { }, function(event,args) local player = args.player if Admin.is_banned(player,true) ~= 'jail' then player_return({'ExpGamingAdmin.cant-report-ban',args.player.name}) return commands.error end + Admin.set_banned(player,false) Server.interface(Role.revert,true,player,event.player_index,2) end) \ No newline at end of file diff --git a/modules/ExpGamingAdmin/Jail/control.lua b/modules/ExpGamingAdmin/Jail/control.lua index 692cdebb..dcdcf211 100644 --- a/modules/ExpGamingAdmin/Jail/control.lua +++ b/modules/ExpGamingAdmin/Jail/control.lua @@ -48,4 +48,4 @@ end Admin.add_action('Jail',Admin.jail) -- Module Return -return ThisModule \ No newline at end of file +return setmetatable(ThisModule,{__call=Admin.jail}) \ No newline at end of file diff --git a/modules/ExpGamingAdmin/Kick/control.lua b/modules/ExpGamingAdmin/Kick/control.lua index 38108f86..4b13003d 100644 --- a/modules/ExpGamingAdmin/Kick/control.lua +++ b/modules/ExpGamingAdmin/Kick/control.lua @@ -44,4 +44,4 @@ end Admin.add_action('Kick',Admin.kick) -- Module Return -return ThisModule \ No newline at end of file +return setmetatable(ThisModule,{__call=Admin.kick}) \ No newline at end of file diff --git a/modules/ExpGamingAdmin/Teleport/control.lua b/modules/ExpGamingAdmin/Teleport/control.lua index 36dc5a77..75e9f2ca 100644 --- a/modules/ExpGamingAdmin/Teleport/control.lua +++ b/modules/ExpGamingAdmin/Teleport/control.lua @@ -40,4 +40,4 @@ Admin.add_action('Go To',Admin.go_to) Admin.add_action('Bring',Admin.bring) -- Module Return -return ThisModule \ No newline at end of file +return setmetatable(ThisModule,{__call=Admin.tp}) \ No newline at end of file diff --git a/modules/ExpGamingAdmin/TempBan/control.lua b/modules/ExpGamingAdmin/TempBan/control.lua index e5108047..c103ab84 100644 --- a/modules/ExpGamingAdmin/TempBan/control.lua +++ b/modules/ExpGamingAdmin/TempBan/control.lua @@ -45,4 +45,4 @@ end Admin.add_action('Temp Ban',Admin.temp_ban) -- Module Return -return ThisModule \ No newline at end of file +return setmetatable(ThisModule,{__call=Admin.temp_ban}) \ No newline at end of file diff --git a/modules/ExpGamingAdmin/Warnings/control.lua b/modules/ExpGamingAdmin/Warnings/control.lua index 0d7b0494..4c85fa6f 100644 --- a/modules/ExpGamingAdmin/Warnings/control.lua +++ b/modules/ExpGamingAdmin/Warnings/control.lua @@ -13,7 +13,7 @@ local Color -- FactorioStdLib.Color@^0.8.0 local Sync -- ExpGamingCore.Sync@^4.0.0 -- Local Varibles -local take_action = 7 -- the first admin given warning jumps to this number, this case kick-warn is giving +local take_action = 8 -- the first admin given warning jumps to this number, this case kick-warn is giving local remove_warnings_time = {} local min_time_to_remove_warning = 18000 -- this is in ticks local punishments = { @@ -92,9 +92,9 @@ end function Admin.give_warning(player,by_player,reason,min) local player, by_player = Admin.valid_players(player,by_player) if not player then return end - local min = Game.get_player(by_player) and take_action or min or 0 + local min = Game.get_player(by_player) and Game.get_player(by_player) ~= SERVER and take_action or min or 0 local warnings = Admin.get_warnings(player) - if warnings < min then warnings = min end + if warnings < min then warnings = min-1 end warnings = warnings+1 global[player.name] = warnings if warnings > take_action then diff --git a/modules/ExpGamingAdmin/control.lua b/modules/ExpGamingAdmin/control.lua index bbacd4c2..e5019387 100644 --- a/modules/ExpGamingAdmin/control.lua +++ b/modules/ExpGamingAdmin/control.lua @@ -77,8 +77,8 @@ function Admin.add_action(action,callback) end function Admin.take_action(action,player,by_player,reason) - if Admin[action] then Admin[action](player,by_player,reason) end if Admin.action_functions[string.lower(action)] then Admin.action_functions[string.lower(action)](player,by_player,reason) end + if Admin[action] then Admin[action](player,by_player,reason) end end function Admin.clear_player(player,by_player) diff --git a/modules/ExpGamingCore/Role/control.lua b/modules/ExpGamingCore/Role/control.lua index 52c30fd8..aef02653 100644 --- a/modules/ExpGamingCore/Role/control.lua +++ b/modules/ExpGamingCore/Role/control.lua @@ -281,7 +281,7 @@ function Role.print(role,rtn,colour,inv) if colour and not type_error(colour,'table','Invalid argument #3 to Role.print, colour is not a table.') then return end if inv and not type_error(inv,'boolean','Invalid argument #4 to Role.print, inv is not a boolean.') then return end local message = inv and {'ExpGamingCore-Role.default-print',rtn} or {'ExpGamingCore-Role.print',role.name,rtn} - local change = inv and -1 or 1 + local change = inv and 1 or -1 local ctn = 0 local i = role.index while true do