so guys i'm try make a jailed in a new place but i can't make player can't teleport from this place
it is new place
and that is mypos to place
3229/3503/0
and this is code isInJail
Code:
public boolean isInJail() {
if(absX >= 2065 && absX <= 2111 && absY >= 4415 && absY <= 4455) {
return true;
}
return false;
}
jail command
Code:
if (playerCommand.startsWith("jail")) {
try {
String[] playerToBan = playerCommand.split(" ", 2);
for (int i = 0; i < Config.MAX_PLAYERS; i++) {
if (PlayerHandler.players[i] != null) {
if (PlayerHandler.players[i].playerName
.equalsIgnoreCase(playerToBan[1])) {
Client c2 = (Client) PlayerHandler.players[i];
if (c2.duelStatus == 5) {
c.sendMessage("You cant jail a player when he is during a duel.");
return;
}
c2.teleportToX = 3228;
c2.teleportToY = 3501;
c2.sendMessage("You have been jailed by "
+ c.playerName + " .");
c.sendMessage("Successfully Jailed "
+ c2.playerName + ".");
}
}
}
} catch (Exception e) {
c.sendMessage("Player Must Be Offline.");
}
}