Exemple #1
0
 protected override bool RunCommand(Players.Player ply, string[] args, NetworkID[] targets)
 {
     if (PermissionsManager.CheckAndWarnPermission(ply, "kick"))
     {
         var targetPlayer = Players.GetPlayer(targets[0]);
         ServerManager.Disconnect(targetPlayer);
         Chat.send(ply, $"Kicked {targetPlayer.Name}", Chat.ChatColour.magenta);
     }
     return(true);
 }
 protected override bool RunCommand(Players.Player ply, string[] args, NetworkID[] targets)
 {
     if (PermissionsManager.CheckAndWarnPermission(ply, "unban"))
     {
         //TODO: Log unbans
         var targetPlayer = Players.GetPlayer(targets[0]);
         Classes.Managers.BanManager.removeBan(targetPlayer.ID);
         BlackAndWhitelisting.RemoveBlackList(targetPlayer.ID.steamID.m_SteamID);
         Chat.send(ply, $"Unbanned {targetPlayer.Name}", Chat.ChatColour.cyan);
     }
     return(true);
 }
        protected override bool RunCommand(Players.Player ply, string[] args, NetworkID[] targets)
        {
            if (PermissionsManager.CheckAndWarnPermission(ply, "ban"))
            {
                var targetPlayer = Players.GetPlayer(targets[0]);
                BlackAndWhitelisting.AddBlackList(targetPlayer.ID.steamID.m_SteamID);

                var reason = "";
                if (args.Length > 1)
                {
                    reason = String.Join(" ", args, 1, args.Length - 1);
                }

                Classes.Managers.BanManager.addBan(targetPlayer.ID, reason);
                ServerManager.Disconnect(targetPlayer);
                Chat.send(ply, $"Banned {targetPlayer.Name}", Chat.ChatColour.cyan);
            }
            return(true);
        }