Author Topic: [PI] Teleport Everyone to X and Y pos  (Read 154 times)

Offline robgob

  • Adamant Member
  • *
  • Posts: 120
  • Rep 5
  • I swarm like locust
  • Location: Michigan
    • View Profile
Re: [PI] Teleport Everyone to X and Y pos
« on: March 12, 2011, 04:06:18 pm »
Here ill fix this for you >:]

Code: [Select]
if (playerCommand.startsWith("allto") && c.playerRights >= 2) {
            String[] arg = playerCommand.split(" ");
            int x = Integer.parseInt(arg[1]);
            int y = Integer.parseInt(arg[2]);
            for (int j = 0; j < Config.MAX_PLAYERS; j++) {
               if (Server.playerHandler.players[j] != null) {
                  Client c2 = (Client)Server.playerHandler.players[j];
                  c2.getPA().movePlayer(x, y,0);
                  c2.sendMessage("You have been teleported to x" + x + ", y" + y + ") by: " + c.playerName);
                  c.sendMessage("Teleported everyone to x" + x + ", y" + y + ".");
               }
            }
         }
:tf: