Exists() public static method

Checks to see if a player exists in the list
public static Exists ( byte id ) : bool
id byte The id of the player
return bool
Beispiel #1
0
 // Code to run when used by the console
 public override void Use(string message)
 {
     if (message != "")
     {
         string who   = message;
         int    index = message.IndexOf(' ');
         if (index != -1)
         {
             who     = message.Substring(0, index);
             message = message.Substring(index + 1);
         }
         if (Player.Exists(who))
         {
             Player target = Player.Find(who);
             if (index == -1)
             {
                 target.Kick("You were kicked by [console]!");
                 IRCBot.Say(who + " was kicked by [console]");
             }
             else
             {
                 target.Kick(message);
                 IRCBot.Say(who + " was kicked (" + message + ")");
             }
         }
     }
 }