mirror of
https://github.com/Refactorio/RedMew.git
synced 2025-01-26 03:52:00 +02:00
Please-dont-crash-the-server-tempban-fix
This commit is contained in:
parent
8bced79fdf
commit
8014be1735
@ -422,10 +422,12 @@ local function get_group()
|
||||
if not group then
|
||||
game.permissions.create_group("Banned")
|
||||
group = game.permissions.get_group("Banned")
|
||||
if group then
|
||||
for i=2,174 do
|
||||
group.set_allows_action(i, false)
|
||||
end
|
||||
end
|
||||
end
|
||||
return group
|
||||
end
|
||||
|
||||
@ -450,6 +452,7 @@ local function tempban(cmd)
|
||||
end
|
||||
local group = get_group()
|
||||
game.print(get_actor() .. " put " .. params[1] .. " in timeout for " .. params[2] .. " minutes.")
|
||||
if group then
|
||||
group.add_player(params[1])
|
||||
if not tonumber(cmd.parameter) then
|
||||
Thread.set_timeout(
|
||||
@ -462,6 +465,7 @@ local function tempban(cmd)
|
||||
)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
commands.add_command("kill", "Will kill you.", kill)
|
||||
commands.add_command("detrain", "<player> - Kicks the player off a train. (Admins and moderators)", detrain)
|
||||
|
Loading…
x
Reference in New Issue
Block a user