Guest User

Untitled

a guest
Oct 16th, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.11 KB | None | 0 0
  1. @SuppressWarnings("deprecation")
  2. public class PlayerListener implements Listener {
  3. public static main plugin;
  4. public static Economy econ;
  5. public static WorldGuardPlugin wgp;
  6. public Map<Enchantment, Integer> ienchleri = new HashMap<Enchantment, Integer>();
  7. @EventHandler(priority = EventPriority.HIGH)
  8. public void onPlayerChat(PlayerChatEvent event){
  9. Player p = event.getPlayer();
  10. String mesaj = event.getMessage();
  11. String degistir = "Admin bey 10x10 luk bir region almak istiyorum ! ";
  12. String degistir2 = "Admin bey 20x20 lik bir region almak istiyorum ! ";
  13. if (mesaj.toLowerCase().equalsIgnoreCase("wg 10x10")){
  14. if (econ.hasAccount(degistir2)){
  15. event.setMessage(degistir);
  16. econ.withdrawPlayer(p.getName(), 5000.00);
  17. p.sendMessage("Yeterli paraniz bulunmakta paranizi aldirdim !!");
  18. } else {
  19. event.setCancelled(true);
  20. p.sendMessage("Yeterli paraniz bulunmamakta paranizi aldiramadim :(");
  21. }
  22. } else if (mesaj.toLowerCase().equalsIgnoreCase("wg 20x20")){
  23. event.setMessage(degistir2);
  24. }
  25. }
  26. }
Add Comment
Please, Sign In to add comment