Advertisement
Guest User

Untitled

a guest
Apr 25th, 2014
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.43 KB | None | 0 0
  1. options:
  2. prefix : &7[&3Vote&7]&b
  3.  
  4. variables:
  5. {invote} = false
  6. {votes.y} = 0
  7. {votes.n} = 0
  8.  
  9. command /startvote <text>:
  10. description: Starts a vote
  11. usage: /startvote <vote>
  12. permission: skript.vote.start
  13. permission message: You don't have permission to use this command
  14. executable by: players and console
  15. trigger:
  16. if {invote} is true:
  17. message "{@prefix} There is already a vote in progress!" to command sender
  18. else:
  19. set {invote} to true
  20. set {votes.y} to 0
  21. set {votes.n} to 0
  22. loop all players:
  23. set {voted.%loop-player%} to false
  24. broadcast "{@prefix} Vote started for %arg 1%"
  25. broadcast "{@prefix} Answer in chat by saying 'y' or 'n'"
  26.  
  27. command /endvote:
  28. description: Ends a vote
  29. usage: /endvote
  30. permission: skript.vote.end
  31. permission message: You don't have permission to use this command
  32. executable by: players and console
  33. trigger:
  34. {invote} is true
  35. set {invote} to false
  36. broadcast "{@prefix} Vote ended! Yes had %{votes.y}% results, and No had %{votes.n}% results!"
  37.  
  38. on chat:
  39. if message is equal to "y":
  40. {invote} is true
  41. {voted.%player%} is false
  42. add 1 to {votes.y}
  43. set {voted.%player%} to true
  44. cancel the event
  45. message "{@prefix} Your vote has been counted" to the player
  46. else if message is equal to "n":
  47. {invote} is true
  48. {voted.%player%} is false
  49. add 1 to {votes.n}
  50. set {voted.%player%} to true
  51. cancel the event
  52. message "{@prefix} Your vote has been counted" to the player
  53. else:
  54. stop
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement