Guest User

Script

a guest
Feb 15th, 2013
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function increaseVotes() {
  2.   var voteFile = new java.io.File(plugin.getDataFolder(), "vote-counts");
  3.   var config = org.bukkit.configuration.file.YamlConfiguration.loadConfiguration(voteFile);
  4.   var count = config.getInt(target + ".votes");
  5.   count++;
  6.   config.set(target + ".votes", count);
  7.   config.save(voteFile);
  8. }
  9.  
  10. function getVoteCount() {
  11.   var voteFile = new java.io.File(plugin.getDataFolder(), "vote-counts");
  12.   var config = org.bukkit.configuration.file.YamlConfiguration.loadConfiguration(voteFile);
  13.   return config.getInt(target + ".votes");
  14. }
  15.  
  16. increaseVotes();
  17. if (getVoteCount() == 1) {
  18.   command("eco give %target% 100")
  19. } else if (getVoteCount() == 4) {
  20.   command("manuadd %target% mayor world")
  21. } else if (getVoteCount() == 20) {
  22.   command("manuadd %target% governor world")
  23. } else if (getVoteCount() == 40) {
  24.   command("manuadd %target% senator world")
  25. } else if (getVoteCount() == 60) {
  26.   command("manuadd %target% vicepresident world")
  27. } else if (getVoteCount() == 80) {
  28.   command("manuadd %target% president world")
  29. } else if (getVoteCount() == 100) {
  30.   command("manuadd %target% worldleader world")
  31. } else if (getVoteCount() == 120) {
  32.   command("manuadd %target% realmruler world")
  33. } else if (getVoteCount() == 140) {
  34.   command("manuadd %target% demigod world")
  35. } else if (getVoteCount() == 240) {
  36.   command("manuadd %target% legend world")
  37. }
Advertisement
Add Comment
Please, Sign In to add comment