Advertisement
mrextremez

Yel

Apr 24th, 2014
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.32 KB | None | 0 0
  1. package com.zarketh.model.entity.player.commands.impl;
  2.  
  3. import com.zarketh.InstanceDistributor;
  4. import com.zarketh.model.entity.player.Player;
  5. import com.zarketh.model.entity.player.commands.Command;
  6. import com.zarketh.util.Misc;
  7.  
  8. /**
  9. * Handles the yell command, send a global message from user.
  10. *
  11. * @author Renual
  12. * @author Jordon
  13. */
  14. public class Yell implements Command {
  15.  
  16. @Override
  17. public void execute(final Player player, final String command) {
  18. if (player.getPrivileges() >= 1)
  19. if (command.length() > 5) {
  20. final String words = command.substring(5);
  21. if (player.isYellMuted() || player.isMuted()) {
  22. player.getActionSender().sendMessage("You are muted.");
  23. return;
  24. }
  25. String prefix = "";
  26. if (player.getPrivileges() > 5 && player.getPrivileges() < 8 && System.currentTimeMillis() - player.donatorTimer > 60000) {
  27. if (player.getPrivileges() == 8) {
  28. prefix = "[Supporter]";
  29. } else if (player.getPrivileges() == 7) {
  30. prefix = "<shad=15695415>[Donator]</col><img=0>";
  31. } else if (player.getPrivileges() == 6) {
  32. prefix = "<shad=15695415>[Super Donator]</col><img=0>";
  33. } else if (player.getPrivileges() == 5) {
  34. prefix = "<shad=15695415>[Extreme Donator]</col><img=0>";
  35. } else if (player.getPrivileges() == 4 && !player.username.equalsIgnoreCase("mitchell")) {
  36. prefix = "[V. I. P]";
  37. } else if (player.username.equalsIgnoreCase("mitchell")) {
  38. prefix = "<shad=16777215>[Co Owner]</col><img=2>";
  39. } else if (player.getPrivileges() == 3) {
  40. prefix = "<shad=16777215>[Owner]</col><img=2>";
  41. } else if (player.getPrivileges() == 2) {
  42. prefix = "<shad=6081134>[Administrator]</col><img=2>";
  43. } else if (player.getPrivileges() == 1) {
  44. prefix = "<shad=255>[Moderator]</col><img=1>";
  45. }
  46. player.donatorTimer = System.currentTimeMillis();
  47. InstanceDistributor.getGlobalActions().sendMessage(prefix + Misc.capitalizeFirstLetter(player.getUsername()) + ": " + words);
  48. } else if (player.getPrivileges() > 5 && player.getPrivileges() < 8 && System.currentTimeMillis() - player.donatorTimer < 60000) {
  49. player.getActionSender().sendMessage("You must wait 60 seconds between each yell.");
  50. } else {
  51. player.getActionSender().sendMessage("Syntax is ::yell <message>.");
  52. }
  53. }
  54. }
  55.  
  56. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement