mirror of
https://github.com/PHIDIAS0303/ExpCluster.git
synced 2025-12-30 20:41:41 +09:00
Another Bug Bash
This commit is contained in:
@@ -46,4 +46,4 @@ end
|
|||||||
Admin.add_action('Ban',Admin.ban)
|
Admin.add_action('Ban',Admin.ban)
|
||||||
|
|
||||||
-- Module Return
|
-- Module Return
|
||||||
return ThisModule
|
return setmetatable(ThisModule,{__call=Admin.ban})
|
||||||
@@ -55,4 +55,4 @@ end
|
|||||||
|
|
||||||
Admin.add_action('Clear Inventory',Admin.move_inventory)
|
Admin.add_action('Clear Inventory',Admin.move_inventory)
|
||||||
-- Module Return
|
-- Module Return
|
||||||
return ThisModule
|
return setmetatable(ThisModule,{__call=Admin.move_inventory})
|
||||||
@@ -25,5 +25,6 @@ commands.add_command('unjail', 'Returns a player\'s old rank', {
|
|||||||
}, function(event,args)
|
}, function(event,args)
|
||||||
local player = args.player
|
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
|
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)
|
Server.interface(Role.revert,true,player,event.player_index,2)
|
||||||
end)
|
end)
|
||||||
@@ -48,4 +48,4 @@ end
|
|||||||
Admin.add_action('Jail',Admin.jail)
|
Admin.add_action('Jail',Admin.jail)
|
||||||
|
|
||||||
-- Module Return
|
-- Module Return
|
||||||
return ThisModule
|
return setmetatable(ThisModule,{__call=Admin.jail})
|
||||||
@@ -44,4 +44,4 @@ end
|
|||||||
Admin.add_action('Kick',Admin.kick)
|
Admin.add_action('Kick',Admin.kick)
|
||||||
|
|
||||||
-- Module Return
|
-- Module Return
|
||||||
return ThisModule
|
return setmetatable(ThisModule,{__call=Admin.kick})
|
||||||
@@ -40,4 +40,4 @@ Admin.add_action('Go To',Admin.go_to)
|
|||||||
Admin.add_action('Bring',Admin.bring)
|
Admin.add_action('Bring',Admin.bring)
|
||||||
|
|
||||||
-- Module Return
|
-- Module Return
|
||||||
return ThisModule
|
return setmetatable(ThisModule,{__call=Admin.tp})
|
||||||
@@ -45,4 +45,4 @@ end
|
|||||||
Admin.add_action('Temp Ban',Admin.temp_ban)
|
Admin.add_action('Temp Ban',Admin.temp_ban)
|
||||||
|
|
||||||
-- Module Return
|
-- Module Return
|
||||||
return ThisModule
|
return setmetatable(ThisModule,{__call=Admin.temp_ban})
|
||||||
@@ -13,7 +13,7 @@ local Color -- FactorioStdLib.Color@^0.8.0
|
|||||||
local Sync -- ExpGamingCore.Sync@^4.0.0
|
local Sync -- ExpGamingCore.Sync@^4.0.0
|
||||||
|
|
||||||
-- Local Varibles
|
-- 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 remove_warnings_time = {}
|
||||||
local min_time_to_remove_warning = 18000 -- this is in ticks
|
local min_time_to_remove_warning = 18000 -- this is in ticks
|
||||||
local punishments = {
|
local punishments = {
|
||||||
@@ -92,9 +92,9 @@ end
|
|||||||
function Admin.give_warning(player,by_player,reason,min)
|
function Admin.give_warning(player,by_player,reason,min)
|
||||||
local player, by_player = Admin.valid_players(player,by_player)
|
local player, by_player = Admin.valid_players(player,by_player)
|
||||||
if not player then return end
|
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)
|
local warnings = Admin.get_warnings(player)
|
||||||
if warnings < min then warnings = min end
|
if warnings < min then warnings = min-1 end
|
||||||
warnings = warnings+1
|
warnings = warnings+1
|
||||||
global[player.name] = warnings
|
global[player.name] = warnings
|
||||||
if warnings > take_action then
|
if warnings > take_action then
|
||||||
|
|||||||
@@ -77,8 +77,8 @@ function Admin.add_action(action,callback)
|
|||||||
end
|
end
|
||||||
|
|
||||||
function Admin.take_action(action,player,by_player,reason)
|
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_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
|
end
|
||||||
|
|
||||||
function Admin.clear_player(player,by_player)
|
function Admin.clear_player(player,by_player)
|
||||||
|
|||||||
@@ -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 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
|
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 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 ctn = 0
|
||||||
local i = role.index
|
local i = role.index
|
||||||
while true do
|
while true do
|
||||||
|
|||||||
Reference in New Issue
Block a user