ShooterowyPL

PlayerHunt

Dec 30th, 2015
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.99 KB | None | 0 0
  1. #Author: Shooterowy
  2. options:
  3. tag: &a[&6Player&4Hunt&a] #Tag skryptu
  4. min_lore_length: 35 #Minimalna dlugosc opisu zlecenia
  5. command /playerhunt [<text="zlecenia">] [<text>]:
  6. aliases: phunt, polowanie, ph
  7. trigger:
  8. if arg 1 is not set:
  9. send "{@tag} &3Commands:"
  10. send "&1/&3playerhunt zlecenie &1<&3player&1>"
  11. send "&1/&3playerhunt zlecenia"
  12. if arg 1 is "zlecenia":
  13. set {_z} to size of {playerhunt::list::*}
  14. open chest with 6 rows named "&3Zlecenia (&c%{_z}%&3)" to player
  15. wait 3 ticks
  16. loop 54 times:
  17. format slot loop-number - 1 of player with 1 of light gray glass pane named " " to be unstealable
  18. set {_slot} to 0
  19. loop {playerhunt::list::*}:
  20. wait 3 ticks
  21. set {_victim} to loop-index parsed as player
  22. set {_nagroda} to " "
  23. loop {playerhunt::list::%{_victim}%::prize::*}:
  24. set {_nagroda} to "%{_nagroda}%&a- %loop-value-2%|| "
  25. format slot {_slot} of player with 1 of {_victim}'s skull named "&4%{_victim}%" with lore "&6Zleceniodawca: &a%{playerhunt::list::%{_victim}%::principal}%||&6Opis: &a%{playerhunt::list::%{_victim}%::lore}%||&6Nagroda:||%{_nagroda}%" to be unstealable
  26. add 1 to {_slot}
  27. if arg 1 is "prize":
  28. wait 3 ticks
  29. open chest with 6 rows named "&4%arg 2%&3: Nagroda" to player
  30. wait 3 ticks
  31. add {playerhunt::list::%arg 2%::prize::*} to current inventory of player
  32. if arg 1 is "zlecenie":
  33. if arg 2 is set:
  34. if size of {playerhunt::list::*} is smaller than 54:
  35. if arg 2 parsed as player is online:
  36. if arg 2 parsed as player is not player:
  37. if {playerhunt::list::%arg 2%} is not set:
  38. set {playerhunt::cache::%player%} to arg 2
  39. send "{@tag} &3Podaj na czacie opis do zlecenia. Maksymalna ilosc znakow to {@min_lore_length}."
  40. send "{@tag} &3Jezeli nie chcesz ustawiac opisu zlecenie napisz na czacie ""NULL""."
  41. send "{@tag} &3Jezeli chcesz anulawac zlecenie napisz na czacie ""CANCEL""."
  42. stop
  43. else:
  44. send "{@tag} &cTen gracz jest juz na liscie."
  45. stop
  46. else:
  47. send "{@tag} &cNie mozesz wystawic zlecenia na siebie."
  48. stop
  49. else:
  50. send "{@tag} &cTen gracz jest niedostepny."
  51. stop
  52. else:
  53. send "{@tag} &cLista zlecen jest pelna. Poczekaj az zwolni sie miejsce."
  54. stop
  55. else:
  56. send "{@tag} &cPoprawne uzycie: &1/&3playerhunt zlecenie &1<&3player&1>"
  57. stop
  58. command /nagrody:
  59. trigger:
  60. if size of {nagrody::%player%::*} is not 0:
  61. send "{@tag} &cPo zamknieciu ekwipunku przedmioty znikna."
  62. open chest with 6 rows named "&3Nagroda" to player
  63. add {nagrody::%player%::*} to current inventory of player
  64. clear {nagrody::%player%::*}
  65. stop
  66. else:
  67. send "{@tag} &cNie masz zadnej nagrody do odebrania!"
  68. stop
  69. on chat:
  70. if {playerhunt::cache::%player%} is set:
  71. if {playerhunt::list::%{playerhunt::cache::%player%}%::lore} is not set:
  72. cancel event
  73. if message is "CANCEL":
  74. clear {playerhunt::cache::%player%}
  75. send "{@tag} &cZlecenie zostalo anulowane."
  76. stop
  77. else if message is "NULL":
  78. set {playerhunt::list::%{playerhunt::cache::%player%}%::lore} to "Brak opisu."
  79. else:
  80. if length of message is more than {@min_lore_length}:
  81. send "{@tag} &cMaksymalna dlugosc opisu wynosi {@min_lore_length}."
  82. stop
  83. set {playerhunt::list::%{playerhunt::cache::%player%}%::lore} to "%message%"
  84. set {playerhunt::list::%{playerhunt::cache::%player%}%} to {playerhunt::cache::%player%}
  85. set {playerhunt::list::%{playerhunt::cache::%player%}%::principal} to player
  86. open chest with 6 rows named "&3Ustaw nagrode" to player
  87. send "{@tag} &3Opis zostal ustawiony. Teraz ustaw nagrode."
  88. send "{@tag} &3W przypadku nieustalenia nagrody, zlecenie zostanie anulowane."
  89. stop
  90.  
  91. on inventory close:
  92. if inventory name of current inventory of player is "&3Ustaw nagrode":
  93. if {playerhunt::cache::%player%} is set:
  94. loop items in current inventory of player:
  95. add loop-item to {playerhunt::list::%{playerhunt::cache::%player%}%::prize::*}
  96. if size of {playerhunt::list::%{playerhunt::cache::%player%}%::prize::*} is not 0:
  97. broadcast "{@tag} &6%player% &3pragnie smierci gracza &6%{playerhunt::cache::%player%}%&3."
  98. else:
  99. send "{@tag} &cNie ustawiono nagrody. Zlecenie zostalo anulowane."
  100. clear {playerhunt::list::%{playerhunt::cache::%player%}%::*}
  101. clear {playerhunt::list::%{playerhunt::cache::%player%}%}
  102. clear {playerhunt::cache::%player%}
  103. stop
  104.  
  105. on death:
  106. if victim is a player:
  107. if attacker is a player:
  108. if victim is not attacker:
  109. if {playerhunt::list::%victim%} is set:
  110. loop {playerhunt::list::%victim%::prize::*}:
  111. add loop-value to {nagrody::%attacker%::*}
  112. broadcast "{@tag} &6%attacker% &3zabil gracza &6%victim%&3, wykonujac tym samym zlecenie gracza &6%{playerhunt::list::%victim%::principal}%&3."
  113. send "{@tag} &3Nagrode mozesz odebrac pod komenda &6/nagrody&3." to attacker
  114. clear {playerhunt::list::%victim%::*}
  115. clear {playerhunt::list::%victim%}
  116. stop
Add Comment
Please, Sign In to add comment