public void Ban(string reason = "no reason") { ServerUsers.Set(GameID, ServerUsers.UserGroup.Banned, Name, reason); ServerUsers.Save(); Kick("[BAN] " + reason); }
public static void ban(ConsoleSystem.Arg arg) { Player player = Player.Find(arg.ArgsStr); if (player != null) { string nameFrom; if (arg.connection != null && arg.connection.username != null) { nameFrom = arg.connection.username; } else { nameFrom = "RCON"; } player.Ban("Banned by: " + nameFrom); Server.GetServer().Broadcast(arg.ArgsStr + " is banned from the server by " + nameFrom + "!"); arg.ReplyWith(arg.ArgsStr + " is banned!"); } else { arg.ReplyWith("Couldn't find player: " + arg.ArgsStr); } }