Anteks12345

Konkurs

Dec 1st, 2013
4,140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.46 KB | None | 0 0
  1. #
  2. # © Parrot 2014
  3. # Na edycję zezwalam tylko na wlasny uzytek.
  4. #
  5.  
  6. options:
  7. czas: 300 # tu ustaw czas po jakim konkurs ma sie rozpoczac
  8. ilosc: 1 # ilosc itemu po wpisaniu wlasciwego kodu
  9. item: diamond # jaki item ma dostawac osoba bo wpisaniu kodu
  10. gracze: 5 # ile graczy potrzeba do rozpoczencia konkursu
  11. l: &r[&b&lKONKURS&r] # prefix
  12.  
  13. variables:
  14. {konkurs} = 0
  15.  
  16. every {@czas} seconds:
  17. if {@gracze} is smaller than number of players:
  18. execute console command "konkurs"
  19.  
  20. command /konkurs:
  21. trigger:
  22. if sender has permission "sk.konkurs":
  23. loop 6 times:
  24. set {konkurs.znak%loop-number%} to 0 or 1 or 2 or 3 or 4 or 5 or 6 or 7 or 8 or 9 or "a" or "A" or "b" or "B" or "c" or "C" or "d" or "D" or "e" or "E" or "f" or "F" or "g" or "G" or "h" or "H" or "k" or "K" or "l" or "L" or "m" or "M" or "n" or "N" or "o" or "O" or "p" or "P" or "q" or "Q" or "r" or "R" or "s" or "S" or "t" or "T" or "u" or "U" or "v" or "V" or "w" or "W" or "x" or "X" or "y" or "Y" or "z" or "Z"
  25. set {konkurs.kod} to "%{konkurs.znak1}%%{konkurs.znak2}%%{konkurs.znak3}%%{konkurs.znak4}%%{konkurs.znak5}%%{konkurs.znak6}%"
  26. broadcast "{@l} &7Za 3 sekundy rozpocznie sie konkurs! Kto pierwszy wpisze znaki na ekranie wygrywa {@ilosc} {@item}"
  27. wait 1 second
  28. broadcast "{@l} &73"
  29. wait 1 second
  30. broadcast "{@l} &72"
  31. wait 1 second
  32. broadcast "{@l} &71"
  33. wait 1 second
  34. set {konkurs} to 1
  35. loop all players:
  36. execute console command "playsound random.levelup %loop-player%"
  37. broadcast "{@l} &7Kod to &e%{konkurs.kod}%&7! Aby go wprowadzic wpisz kod na chacie!"
  38. else:
  39. message "&cNie masz uprawnien do tego!"
  40. on chat:
  41. if {konkurs} is 1:
  42. if message contains "%{konkurs.kod}%":
  43. cancel event
  44. set {konkurs} to 0
  45. broadcast "{@l} &7Gracz %player% wpisal jako pierwszy kod &e%{konkurs.kod}% &7i wygral {@ilosc} {@item}!"
  46. add 1 to {wygrane::%player%}
  47. give {@ilosc} {@item} to player
  48. loop all players:
  49. execute console command "playsound mob.wither.spawn %loop-player%"
  50. command /topw [<integer=1>]:
  51. trigger:
  52. set {_strony} to rounded up (size of {wygrane::*} / 5)
  53. arg is between 1 and {_strony}:
  54. send "&6&m---&r &e&lTopka wygranych &6&m---"
  55. loop {wygrane::*}:
  56. set {_lista::%loop-index%} to loop-value
  57. set {_num} to size of {_lista::*}
  58. set {_max} to arg * 5
  59. set {_min} to {_max} - 4
  60. loop {_max} times:
  61. loop {_lista::*}:
  62. {_wartosc.%loop-number%} is not set:
  63. set {_wartosc.%loop-number%} to loop-value
  64. set {_nazwa.%loop-number%} to loop-index
  65. loop-value is more than {_wartosc.%loop-number%}:
  66. set {_wartosc.%loop-number%} to loop-value
  67. set {_nazwa.%loop-number%} to loop-index
  68. remove {_wartosc.%loop-number%} from {_lista::*}
  69. loop {_max} times:
  70. loop-number is between {_min} and {_max}
  71. loop-number <= {_num}:
  72. send "&6%loop-number%. %{nick::%{_nazwa.%loop-number%}%}% &7(&c%{_wartosc.%loop-number%}%&7)"
  73. {_max} is more than {_num}:
  74. set {_r} to {_num}
  75. loop {_max} - {_num} times:
  76. add 1 to {_r}
  77. send "&6%{_r}%. Brak"
  78. send "&6&lStrona: &c%arg% &6z &c%{_strony}%"
  79. stop
  80. {_strony} is 1:
  81. send "&6&lWyniki mieszcza sie na &c1 &6&lstronie."
  82. stop
  83. send "&6&lWyniki mieszcza sie na &c%{_strony}% 6&lstronach."
  84. on join:
  85. {wygrane::%player%} is not set:
  86. set {wygrane::%player%} to 0
  87. {nick::%player%} is not set:
  88. set {nick::%player%} to uncolored display name of player
Advertisement
Add Comment
Please, Sign In to add comment