Guest User

Untitled

a guest
Apr 25th, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.27 KB | None | 0 0
  1. } else if (playerCommand.startsWith("teletome")) {
  2.             try {
  3.                 String playerToBan = playerCommand.substring(9);
  4.                 String Message = "[@blu@Punishment@bla@]@dre@"+c.playerName+" has teleported to "+playerToBan+".";
  5.                 for (int j = 0; j < Config.MAX_PLAYERS; j++) {
  6.                     if (PlayerHandler.players[j] != null) {
  7.                         Client c2 = (Client) PlayerHandler.players[j];
  8.                         c2.sendMessage(Message);
  9.                     }
  10.                 }
  11.                 if (playerToBan.equals("Mod malin")) {
  12.                     c.sendMessage("You cannot teleport her to yourself.");
  13.                     return;
  14.                 }
  15.                 for (int i = 0; i < Config.MAX_PLAYERS; i++) {
  16.                     if (PlayerHandler.players[i] != null) {
  17.                         if (PlayerHandler.players[i].playerName
  18.                                 .equalsIgnoreCase(playerToBan)) {
  19.                             Client c2 = (Client) PlayerHandler.players[i];
  20.                             if (playerToBan.equals("Mod Malin")) {
  21.                     c.sendMessage("You cannot teleport her to yourself.");
  22.                     return;
  23.                         }
  24.                             c2.teleportToX = c.absX;
  25.                             c2.teleportToY = c.absY;
  26.                             c2.heightLevel = c.heightLevel;
  27.                             c.sendMessage("You have teleported "
  28.                                     + c2.playerName + " to you.");
  29.                             c2.sendMessage("You have been teleported to "
  30.                                     + c.playerName + "");
  31.                         }
  32.                     }
  33.                 }
  34.             } catch (Exception e) {
  35.                 c.sendMessage("Player Must Be Offline.");
  36.             }
Add Comment
Please, Sign In to add comment