Esempio n. 1
0
 public override void Use(Player p, string message)
 {
     if (message == "")
     {
         Help(p); return;
     }
     if (p == null)
     {
         Player.SendMessage(p, "This command can only be used in-game!");
         return;
     }
     try
     {
         if (message.ToLower() == "all")
         {
             for (int i = 0; i < PlayerBot.playerbots.Count; i++)
             {
                 if (PlayerBot.playerbots[i].level == p.level)
                 {
                     //   PlayerBot.playerbots.Remove(PlayerBot.playerbots[i]);
                     PlayerBot Pb = PlayerBot.playerbots[i];
                     Pb.removeBot();
                     i--;
                 }
             }
         }
         else
         {
             PlayerBot who = PlayerBot.Find(message);
             if (who == null)
             {
                 Player.SendMessage(p, "There is no bot " + who + "!"); return;
             }
             if (p.level != who.level)
             {
                 Player.SendMessage(p, who.name + " is in a different level."); return;
             }
             who.removeBot();
             Player.SendMessage(p, "Removed bot.");
         }
     }
     catch (Exception e) { Server.ErrorLog(e); Player.SendMessage(p, "Error caught"); }
 }