zeshan

Untitled

Dec 29th, 2013
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.34 KB | None | 0 0
  1. @EventHandler
  2. public void onPlayerInteract5(PlayerInteractEvent ev)
  3. {
  4. if (ev.getAction() == Action.RIGHT_CLICK_BLOCK) {
  5. Block b = ev.getClickedBlock();
  6. if ((b.getType() == Material.SIGN_POST) || (b.getType() == Material.WALL_SIGN)) {
  7. Sign s = (Sign) ev.getClickedBlock().getState();
  8. Player p = ev.getPlayer();
  9. if(s.getLine(0).equalsIgnoreCase("§4Rank Upgrades")) {
  10. PlayerFile yaml = Main.getPlayerYaml(p.getName());
  11. if (s.getLine(1).equalsIgnoreCase("§5Slinger")) {
  12. int amount = 50000;
  13. if (Main.econ.getBalance(p.getName()) == amount) {
  14. p.sendMessage(plugin.getConfig().getString("Not_enough_money").replaceAll("(&([a-f0-9]))", "\u00A7$2"));
  15. } else {
  16. if(s.getLine(0).equalsIgnoreCase("§4Rank Upgrades") && s.getLine(1).equalsIgnoreCase("§5Slinger")) {
  17. Main.econ.withdrawPlayer(p.getName(), amount);
  18. yaml.set("Rank", "Slinger");
  19. yaml.save();
  20. Bukkit.getServer().dispatchCommand(Bukkit.getConsoleSender(), "exec u:" + p.getName() + " a:setgroup v:Slinger w:CrimeRing");
  21. //0 57 5 180.456 -8.1
  22. }
  23. }
  24. }
  25. }
  26. }
  27. }
Advertisement
Add Comment
Please, Sign In to add comment