Another Bug Bash

This commit is contained in:
Cooldude2606
2019-01-05 13:56:29 +00:00
parent 382fee77f0
commit 9e698fb6bd
10 changed files with 12 additions and 11 deletions

View File

@@ -46,4 +46,4 @@ end
Admin.add_action('Ban',Admin.ban)
-- Module Return
return ThisModule
return setmetatable(ThisModule,{__call=Admin.ban})

View File

@@ -55,4 +55,4 @@ end
Admin.add_action('Clear Inventory',Admin.move_inventory)
-- Module Return
return ThisModule
return setmetatable(ThisModule,{__call=Admin.move_inventory})

View File

@@ -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)

View File

@@ -48,4 +48,4 @@ end
Admin.add_action('Jail',Admin.jail)
-- Module Return
return ThisModule
return setmetatable(ThisModule,{__call=Admin.jail})

View File

@@ -44,4 +44,4 @@ end
Admin.add_action('Kick',Admin.kick)
-- Module Return
return ThisModule
return setmetatable(ThisModule,{__call=Admin.kick})

View File

@@ -40,4 +40,4 @@ Admin.add_action('Go To',Admin.go_to)
Admin.add_action('Bring',Admin.bring)
-- Module Return
return ThisModule
return setmetatable(ThisModule,{__call=Admin.tp})

View File

@@ -45,4 +45,4 @@ end
Admin.add_action('Temp Ban',Admin.temp_ban)
-- Module Return
return ThisModule
return setmetatable(ThisModule,{__call=Admin.temp_ban})

View File

@@ -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

View File

@@ -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)

View File

@@ -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