Base: PI 317
Problem: the jail command will jail me not other people if you could help me buy fixing this for me will rep
Errors(Compiling Errors): none
Other Information/Media(Pictures, etc):
Code:
if(playerCommand.startsWith("jail")) {
try {
String playerToBan = playerCommand.substring(5);
c.getPA().movePlayer(3284, 3932, 1);
for(int i = 0; i < Config.MAX_PLAYERS; i++) {
if(Server.playerHandler.players[i] != null) {
if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToBan)) {
Client c2 = (Client)Server.playerHandler.players[i];
c2.sendMessage("You have been jailed by "+c.playerName+" for 30 minutes.");
}
}
}
} catch(Exception e) {
c.sendMessage("Player Must Be Offline.");
}
}
- thanks