Advertisement
Guest User

Untitled

a guest
Nov 20th, 2014
189
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.08 KB | None | 0 0
  1. public static void findTarget(Client player) {
  2. if (player.getTargetIndex() > 0)
  3. return;
  4. // System.out.println("we got here.");
  5. for (int indices = 0; indices < PlayerHandler.players.length; indices++) {
  6. Client entities = (Client) PlayerHandler.players[indices];
  7. if (entities == null) {
  8. continue;
  9. }
  10. if (entities.inWild()) {
  11. int random = PlayerHandler.players[indices].getId();
  12. Client os = (Client) PlayerHandler.players[random];
  13. // System.out.println("we got here 2");
  14. if (os == null)
  15. continue;
  16. System.out.println("we got here 3.");
  17. if (os.getTargetIndex() > 0)
  18. continue;
  19. if (os.playerId == player.getId())
  20. continue;
  21. int target = os.getId();
  22. os.setTargetIndex(player.getId());
  23. player.setTargetIndex(target);
  24. player.getPA().createPlayerHints(10, target);
  25. os.getPA().createPlayerHints(10, player.getId());
  26. player.sendMessage("You have been assigned to kill "
  27. + os.playerName);
  28. ((Client) os).sendMessage("You have been assigned to kill "
  29. + player.playerName);
  30. }
  31. }
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement