The method returns a bool value, so see in the example below how it is used.
- Code: Select all
public override void Use(Player p, string message)
{
Player who = Player.Find(message);
if (ComparePlayer(who, p))
{
// Code here - the player exists and is a lower rank.
}
}
public bool ComparePlayer(Player who, Player p)
{
if (who == null || who.hidden)
{
Player.SendMessage(p, "Player could not be found.");
return false;
}
if (who.group.Permission >= p.group.Permission)
{
Player.SendMessage(p, "Cannot use this command on a player of greater or equal rank.");
return false;
}
return true;
}