Advertisement
Kacperski89

EliteVote

Jun 5th, 2016
402
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.90 KB | None | 0 0
  1. # EliteVote #
  2.  
  3. options: # KONFIGURACJA SKRYPTU
  4.  
  5. # Nazwa głosowania
  6. name of vote: "Czy lubisz MPCForum?"
  7.  
  8. # Opcje głosowania
  9. opt1: "tak"
  10. opt2: "nie"
  11.  
  12. # Automatyczne glosowanie
  13. automatically: "" # Ustaw "yes" jezeli chcesz ustawic na tak
  14. time: 5 minutes # Czas automatycznego glosowania oraz czas glosowania
  15.  
  16. # Glosowanie - Opcje ogolne
  17. messageVote: "&3Glosowanie rozpoczyna sie!"
  18. messageVote2: "{@name of vote}"
  19.  
  20. vote: "&aDziekujemy za oddanie glosu wyniki po zakonczeniu glosowania!"
  21. errVoted: "&cGlosowales juz! Nie mozesz oddac dwóch glosów"
  22.  
  23. # Wiadomosc po zakonczeniu glosowania
  24. line1: "&4Glosowanie: &cZakonczono glosowanie!"
  25. line2: "&a&lTAK: &6%{vote::yes}%"
  26. line3: "&c&lNIE: &6%{vote::no}%"
  27. line4: "&6OGOLNYCH: &7%{vote::general}%"
  28.  
  29. # Ok! Let's get to the code!
  30.  
  31. method "vote" {}:
  32. set {vote} to true
  33. clear {vote::yes}
  34. clear {vote::no}
  35. clear {vote::general}
  36. broadcast {@messageVote}
  37. broadcast {@messageVote2}
  38. wait {@time}
  39. set {vote} to false
  40. broadcast {@line1}
  41. broadcast {@line2}
  42. broadcast {@line3}
  43. broadcast {@line4}
  44. clear {vote::yes}
  45. clear {vote::no}
  46. clear {vote::general}
  47.  
  48. method "voteYes" {player}:
  49. set {_p} to arg{1};
  50. if {vote::%{_p}%} is false:
  51. add 1 to {vote::yes}
  52. add 1 to {vote::general}
  53. set {vote::%{_p}%} to true
  54. send {@vote} to {_p}
  55. stop
  56. else:
  57. send {@errVoted} to {_p}
  58. stop
  59. method "voteNo" {}:
  60. set {_p} to arg{1};
  61. if {vote::%{_p}%} is false:
  62. add 1 to {vote::no}
  63. add 1 to {vote::general}
  64. set {vote::%{_p}%} to true
  65. send {@vote} to {_p}
  66. stop
  67. else:
  68. send {@errVoted} to {_p}
  69. stop
  70. every {@everyAutoTime}:
  71. set {automatically} to {@automatically}
  72. {automatically} is "yes":
  73. function "vote" {name};
  74.  
  75. command /vote [<text>]:
  76. trigger:
  77. argument 1 is "tak" or "yes":
  78. function "voteYes" {player};
  79. argument 1 is "nie" or "no":
  80. function "voteNo" {player};
  81. argument 1 is "start":
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement