Ejemplo n.º 1
0
        public override void Use(Player p, string message)
        {
            string endresult = "";

            foreach (string line in File.ReadAllLines("ranks/banned.txt"))
            {
                if (Ban.Isbanned(line))
                {
                    endresult = endresult + "&a" + line + Server.DefaultColor + ", ";
                }
                else
                {
                    endresult = endresult + "&c" + line + Server.DefaultColor + ", ";
                }
            }
            if (endresult == "")
            {
                Player.SendMessage(p, "There are no players banned");
            }
            else
            {
                endresult = endresult.Remove(endresult.Length - 2, 2);
                endresult = "&9Banned players: " + Server.DefaultColor + endresult + Server.DefaultColor + ".";
                Player.SendMessage(p, endresult);
            }
        }
Ejemplo n.º 2
0
 public override void Use(Player p, string message)
 {
     string[] data;
     if (message == "")
     {
         Help(p); return;
     }
     if (message.Length <= 3)
     {
         Help(p);
     }
     else
     {
         if (Ban.Isbanned(message))
         {
             data = Ban.Getbandata(message);
             // string[] end = { bannedby, reason, timedate, oldrank, stealth };
             // usefull to know :-)
             string reason   = data[1].Replace("%20", " ");
             string datetime = data[2].Replace("%20", " ");
             Player.SendMessage(p, "&9User: &e" + message);
             Player.SendMessage(p, "&9Banned by: &e" + data[0]);
             Player.SendMessage(p, "&9Reason: &e" + reason);
             Player.SendMessage(p, "&9Date and time: &e" + datetime);
             Player.SendMessage(p, "&9Old rank: &e" + data[3]);
             string stealth; if (data[4] == "true")
             {
                 stealth = "&aYes";
             }
             else
             {
                 stealth = "&cNo";
             }
             Player.SendMessage(p, "&9Stealth banned: " + stealth);
         }
         else if (!Group.findPerm(LevelPermission.Banned).playerList.Contains(message))
         {
             Player.SendMessage(p, "That player isn't banned");
         }
         else if (!Ban.Isbanned(message))
         {
             Player.SendMessage(p, "Couldn't find ban info about " + message + ".");
         }
     }
 }