ShooterowyPL

PlayerHunt

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