Code:
if (playerCommand.startsWith("xteleto")) {
String name = playerCommand.substring(8);
for (int i = 0; i < Config.MAX_PLAYERS; i++) {
if (PlayerHandler.players[i] != null) {
if (PlayerHandler.players[i].playerName.equalsIgnoreCase(name)) {
Client c2 = (Client)PlayerHandler.players[i];
if(c2.InDung()) {
c.sendMessage("You cannot teleport to anyone who is in dung");
return;
}
c.getPA().movePlayer(PlayerHandler.players[i].getX(), PlayerHandler.players[i].getY(), PlayerHandler.players[i].heightLevel);
}
}
}
}
Still able to tele to and tele people out of dung, wondering where im going wrong