Slupik98

areny

Jul 11th, 2014
259
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.86 KB | None | 0 0
  1. command /arena [<text>] [<text>] [<text>]:
  2. trigger:
  3. if arg 1 is "join":
  4. if arg 2 is set:
  5. if {arena.nazwa.%arg 2%} is true:
  6. if {arena.stan.%arg 2%} is "wait":
  7. add 1 to {arena.ile.%arg 2%}
  8. set {arena.stan.player.%player%} to true
  9. set {arena.nazwa.player.%player%} to arg 2
  10. add player to {arena.lista.%arg 2%::*}
  11. send "pomyślnie dołączyłeś do areny %arg 2%"
  12. if {arena.ile.%arg 2%} more than or equal to {arena.ile.max.%arg 2%}:
  13. set {arena.stan.%arg 2%} to "start"
  14. loop {arena.lista.%arg 2%::*}:
  15. set {_nick} to loop-value parsed as player
  16. set {_index} to random integer between 1 and {arena.%arg 2%.ile.spawny}
  17. set {_poz} to {arena.%arg 2%.spawny::%{_index}%}
  18. if {arena.%arg 2%.spawn.%{_poz}%} is set:
  19. teleport {_nick} to {arena.%arg 2%.spawn.%{_poz}%}
  20. else:
  21. send "Wylosowana lokalizacja nie istnieje... Zgłoś się do administratora!" to {_nick}
  22. execute {_nick} command "arena leave"
  23. stop
  24. if {arena.nazwa.%arg 2%} is "start":
  25. send "arena już trwa"
  26. stop
  27. else:
  28. send "nieznany błąd! Napisz do administratora"
  29. else:
  30. send "podana arena nie istnieje!"
  31. else:
  32. send "musisz podać nazwę areny do której chcesz dołączyć"
  33. stop
  34. if arg 1 is "leave":
  35. if {arena.stan.player.%player%} is true:
  36. remove 1 from {arena.ile.%{arena.nazwa.player.%player%}%}
  37. remove player from {arena.lista.%{arena.nazwa.player.%player%}%::*}
  38. set {arena.stan.player.%player%} to false
  39. send "pomyślnie wyszedłęś z areny %{arena.nazwa.player.%player%}%"
  40. teleport player to {arena.lobby.loc}
  41. execute console command "arena sprawdz"
  42. else:
  43. send "nie jesteś na żadnej arenie!"
  44. stop
  45. if arg 1 is "setlobby":
  46. if player have permission "arena.setlobby" or "arena.*":
  47. set {arena.lobby.loc} to location of player
  48. send "zmieniłeś lokalizację lobby!"
  49. else:
  50. send "nie masz do tego praw!"
  51. stop
  52. if arg 1 is "create":
  53. if player have permission "arena.create" or "arena.*":
  54. if arg 2 is set:
  55. if arg 3 is set:
  56. set {_max} to arg 3 parsed as number
  57. if {_max} is set:
  58. if {arena.nazwa.%arg 2%} is not true:
  59. set {arena.nazwa.%arg 2%} to true
  60. set {arena.ile.max.%arg 2%} to {_max}
  61. set {arena.stan.%arg 2%} to "wait"
  62. set {arena.%arg 2%.ile.spawny} to 0
  63. send "pomyślnie utworzono arenę o nazwie %arg 2%"
  64. else:
  65. send "arena już istnieje!"
  66. else:
  67. send "%arg 3% to nie prawidłowa liczba"
  68. else:
  69. send "Musisz podać maksymalą ilość graczy mogących być na arenie!"
  70. else:
  71. send "Musisz podać nazwę areny!"
  72. else:
  73. send "nie masz do tego praw!"
  74. stop
  75. if arg 1 is "setspawn":
  76. if player have permission "arena.setspawn" or "arena.*":
  77. if arg 2 is set:
  78. if {arena.nazwa.%arg 2%} is not true:
  79. if arg 3 is set:
  80. set {_numer} to arg 3 parsed as number
  81. if {_number} is set:
  82. add 1 to {arena.%arg 2%.ile.spawny}
  83. set {arena.%arg 2%.spawn.%{_number}%} to location of player
  84. send "Pomyślnie ustawiono spawn dla areny %arg 2%!"
  85. set {_numerek} to "%{_number}%"
  86. add {_numerek} to {arena.%arg 2%.spawny::*}
  87. else:
  88. send "Podałeś błędną liczbę"
  89. else:
  90. send "Musisz podać numer spawnu"
  91. else:
  92. send "podana arena już istnieje"
  93. else:
  94. send "Musisz podać nazwę areny!"
  95. else:
  96. send "nie masz do tego praw!"
  97. stop
  98. if arg 1 is "sprawdz":
  99. if sender is player:
  100. if player do not have permission "arena.sprwadz" or "arena.*":
  101. send "nie masz do tego praw"
  102. stop
  103. if arg 2 is set:
  104. if {arena.nazwa.%arg 2%} is true:
  105. if {arena.ile.%arg 2%} is 1:
  106. set {_nick} to {arena.lista.%arg 2%::1} parsed as player
  107. send "Wygrałeś arene!" to {_nick}
  108. run {_nick} command "co rollback r:50 t:1h"
  109. execute {_nick} command "arena leave"
  110. set {arena.stan.%arg 2%} to "wait"
  111. if {arena.ile.%arg 2%} less than 1:
  112. Broadcast "Nikt nie wygrał areny %arg 2%"
  113. if {arena.ile.%arg 2%} is more than 1:
  114. loop {arena.lista.%arg 2%::*}:
  115. set {_nick} to loop-value parsed as player
  116. send "na arenie pozostało %% graczy" to {_nick}
  117. else:
  118. send "arena %arg 2% nie istnieje"
  119. else:
  120. send "Musisz pdoac nazwe areny"
  121. send "Nie odnaleziono polecania"
  122. on death of player:
  123. if {arena.stan.player.%victim%} is true:
  124. execute player command "arena leave"
  125. on quit:
  126. if {arena.stan.player.%victim%} is true:
  127. execute player command "arena leave"
  128. on chat:
  129. if {arena.stan.player.%victim%} is true:
  130. cancel event
  131. loop {arena.lista.%{arena.nazwa.player.%player%}%::*}:
  132. set {_nick} to loop-value parsed as player
  133. send "%player%: %message%" to {_nick}
Advertisement
Add Comment
Please, Sign In to add comment