knugi

Untitled

Mar 17th, 2017
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.23 KB | None | 0 0
  1. options:
  2. tag: &8[&9Duels&8]
  3. folder: plugins/Duels
  4.  
  5. on script load:
  6. if folder "{@folder}" doesn't exists:
  7. create folder "{@folder}"
  8. create folder "{@folder}/kits"
  9. create folder "{@folder}/arens"
  10. create folder "{@folder}/users"
  11. create file "{@folder}/config.yml"
  12.  
  13.  
  14. command /duel [<player>]:
  15. trigger:
  16. if arg 1 isn't set:
  17. send "{@tag} &cPodaj gracza z ktorym chcesz walczyc."
  18. stop
  19. if player-arg 1 is online:
  20. if file "{@folder}/%player%.yml" doesn't exists:
  21. if file "{@folder}/%arg 1%.yml" doesn't exists:
  22. open chest with 3 rows named "&eWybierz zestaw" to player
  23. set {_i} to 0
  24. loop 10 times:
  25. set player's current inventory's slot {_i} to gray glass pane named " "
  26. add 1 to {_i}
  27. set {_c} to 17
  28. loop 10 times:
  29. set player's current inventory's slot {_c} to gray glass pane named " "
  30. add 1 to {_c}
  31. set {_x::*} to files in "{@folder}/kits"
  32. send "%size of {_x::*}% - %{_x::*}%"
  33. #10-17
  34. set {_i} to 10
  35. loop 7 times:
  36. if "%{_x::%loop-number%}%" is "<none>":
  37. exit loop
  38. set {_name} to {_x::%loop-number%}
  39. set {_item} to single value "kit.item" get of "{@folder}/kits/%{_name}%" parsed as item type
  40. replace all ".yml" with "" in {_name}
  41. if {_item} is item type:
  42. set player's current inventory's slot {_i} to {_item} named "&c%{_name}%"
  43. else:
  44. set player's current inventory's slot {_i} to diamond sword named "&c%{_name}%"
  45. add 1 to {_i}
  46. stop
  47. else:
  48. send "{@tag} &cTen gracz jest juz podczas walki."
  49. stop
  50. else:
  51. send "{@tag} &cJestes juz podczas walki."
  52. stop
  53. else:
  54. send "{@tag} &cTen gracz jest offline."
  55. stop
  56. on inventory click:
  57. if "%inventory name of player's current inventory%" contains "Wybierz zestaw":
  58. if slot is smaller than 0:
  59. stop
  60. cancel event
  61. if player's current inventory's slot slot is diamond sword:
  62. set {_kit} to uncoloured name of player's current inventory's slot slot
  63. #Kod na wybor kitu....
  64. command /zestaw [<text>] [<text>] [<text>]:
  65. trigger:
  66. if player has permission "duels.*" or "duels.kit":
  67. if arg 1 isn't set:
  68. send "{@tag} &cPoprawne uzycie: &7/zestaw <add/remove/info/item/daj> <nazwaZestawu> *<przedmiot>*"
  69. stop
  70. if arg 1 is "add" or "set":
  71. if arg 2 is set:
  72. if arg 2's length is bigger than or equal to 3:
  73. create file "{@folder}/kits/%arg 2%.yml"
  74. set {_n} to arg 2
  75. set "kit.nazwa" to "%{_n}%" in yaml file "{@folder}/kits/%arg 2%.yml"
  76. set {_i} to 1
  77. loop all items in player's inventory:
  78. set "kit.items.%{_i}%" to "%loop-item%" in yaml file "{@folder}/kits/%arg 2%.yml"
  79. add 1 to {_i}
  80. set "kit.autor" to "%player%" in yaml file "{@folder}/kits/%arg 2%.yml"
  81. set "kit.item" to "stick" in yaml file "{@folder}/kits/%arg 2%.yml"
  82. send "{@tag} &aStworzyles nowy zestaw o nazwie: &1%arg 2%"
  83. stop
  84. else:
  85. send "{@tag} &cNazwa musi zawierac min. 3 znaki."
  86. stop
  87. if arg 1 is "info":
  88. if arg 2 is set:
  89. if file "{@folder}/kits/%arg 2%.yml" exists:
  90. send ""
  91. send "&eZestaw: &7%arg 2%"
  92. set {_n} to single value "kit.nazwa" get of "{@folder}/kits/%arg 2%.yml"
  93. set {_c::*} to configuration section "kit.items" get of "{@folder}/kits/%arg 2%.yml"
  94. loop {_c::*}:
  95. add single value "kit.items.%loop-index%" get of "{@folder}/kits/%arg 2%.yml" to {_items::*}
  96. set {_b} to single value "kit.autor" get of "{@folder}/kits/%arg 2%.yml"
  97. send "&eNazwa: &7%{_n}%"
  98. send "&ePrzedmioty: &7%{_items::*}%"
  99. send "&eAutor: &7%{_b}%"
  100. else:
  101. set {_kitsy::*} to all files in "{@folder}/kits"
  102. loop {_kitsy::*}:
  103. replace all ".yml" in {_kitsy::%loop-index%} with ""
  104. send "{@tag} &cDostepne zestawy: &7%{_kitsy::*}%"
  105. if arg 1 is "daj":
  106. if arg 2 is set:
  107. if file "{@folder}/kits/%arg 2%.yml" exists:
  108. set {_its::*} to configuration section "kit.items" get of "{@folder}/kits/%arg 2%.yml"
  109. loop {_its::*}:
  110. set {_i} to single value "kit.items.%loop-index%" get of "{@folder}/kits/%arg 2%.yml" parsed as item type
  111. send "%{_i}%"
  112. give {_i} to player
  113. send "{@tag} &aOtrzymales zestaw &7%arg 2%"
  114. else:
  115. set {_kitsy::*} to all files in "{@folder}/kits"
  116. loop {_kitsy::*}:
  117. replace all ".yml" in {_kitsy::%loop-index%} with ""
  118. if {_kitsy::*} is not set:
  119. add "-" to {_kitsy::*}
  120. send "{@tag} &cDostepne zestawy: &7%{_kitsy::*}%"
  121. if arg 1 is "item":
  122. if arg 2 is set:
  123. if file "{@folder}/kits/%arg 2%.yml" exists:
  124. if arg 3 is set:
  125. set {_arg} to "%arg 3%" parsed as item type
  126. if {_arg} is item type:
  127. set "kit.item" to "%arg 3%" in yaml file "{@folder}/kits/%arg 2%.yml"
  128. send "{@tag} &aUstawiles przedmiot zestawu &7%arg 2% &ana &7%arg 3%"
  129. stop
  130. else:
  131. send "{@tag} &7%arg 3% &cnie jest typem przedmiotu."
  132. stop
  133. else:
  134. send "{@tag} &cPoprawne uzycie: &7/zestaw item <zestaw> <przedmiot>"
  135. stop
  136. else:
  137. send "{@tag} &cPodany zestaw nie istnieje."
  138. stop
  139. else:
  140. send "{@tag} &cPoprawne uzycie: &7/zestaw item <zestaw> <przedmiot>"
  141. stop
Advertisement
Add Comment
Please, Sign In to add comment