Advertisement
Guest User

Untitled

a guest
Sep 22nd, 2017
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.00 KB | None | 0 0
  1. if (playerCommand.startsWith("ipban")
  2. && (c.isOwner() || c.isAdmin() || c.isHeadAdmin())) { // use
  3. // as
  4. // ::ipban
  5. // name
  6. try {
  7. String playerToBan = playerCommand.substring(6);
  8. for (int i = 0; i < Config.MAX_PLAYERS; i++) {
  9. if (PlayerHandler.players[i] != null) {
  10. if (PlayerHandler.players[i].playerName
  11. .equalsIgnoreCase(playerToBan)) {
  12. Connection
  13. .addIpToBanList(PlayerHandler.players[i].connectedFrom);
  14. Connection
  15. .addIpToFile(PlayerHandler.players[i].connectedFrom);
  16. c.sendMessage("You have IP banned the user: "
  17. + PlayerHandler.players[i].playerName
  18. + " with the host: "
  19. + PlayerHandler.players[i].connectedFrom);
  20. PlayerHandler.players[i].disconnect(true, "player ipbanned by " + c.playerName);
  21. }
  22. }
  23. }
  24. } catch (Exception e) {
  25. c.sendMessage("Player Must Be Offline.");
  26. }
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement