*/
public static boolean checkPlayer(Player player, boolean first)
{
if (first && (!_isRegistrationActive || player.isDead()))
{
show(new CustomMessage("scripts.events.Late", player), player);
return false;
}
if (first && (players_list1.contains(player.getStoredId()) || players_list2.contains(player.getStoredId())))
{
show(new CustomMessage("scripts.events.TvT.Cancelled", player), player);
return false;
}
if ((player.getLevel() < _minLevel) || (player.getLevel() > _maxLevel))
{
show(new CustomMessage("scripts.events.TvT.CancelledLevel", player), player);
return false;
}
if (player.isMounted())
{
show(new CustomMessage("scripts.events.TvT.Cancelled", player), player);
return false;
}
if (player.isInDuel())
{
show(new CustomMessage("scripts.events.TvT.CancelledDuel", player), player);
return false;
}
if (player.getTeam() != TeamType.NONE)
{
show(new CustomMessage("scripts.events.TvT.CancelledOtherEvent", player), player);
return false;
}
if ((player.getOlympiadGame() != null) || (first && Olympiad.isRegistered(player)))
{
show(new CustomMessage("scripts.events.TvT.CancelledOlympiad", player), player);
return false;
}
if (player.isTeleporting())
{
show(new CustomMessage("scripts.events.TvT.CancelledTeleport", player), player);
return false;
}
return true;
}