Guest User

Untitled

a guest
Aug 31st, 2016
453
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 12.94 KB | None | 0 0
  1. options:
  2. tag: &eSklep »
  3. cena: 50 #Jesli zmieniasz tu
  4. startoweLinijki: 2
  5. cenaV: 40
  6. maxLinijek: 5
  7. waluta: gold ingot
  8. vipPerm: jestem.vipem
  9. promien: 15
  10. variables:
  11. {handel:%player%:open} = false
  12. {handel:%player%:ilocs} = 2
  13. {handel:%player%:cena} = 50 #Zmien i tu na to samo co tam
  14.  
  15. function potwierdzZakup(n: integer, koszt: integer, seller: player, buyer: player):
  16. set {_nbr} to {_n}
  17. if {_nbr} is set:
  18. set {_amount} to number of {@waluta} in {_buyer}'s inventory
  19. if {_amount} is greater or equal to {_koszt}:
  20. give {_koszt} of {@waluta} to {_seller}
  21. give {_przedmiot} to {_buyer}
  22. set {handel:%{_seller}%:itemlist::%{_nbr}%} to none
  23. set {handel:%{_seller}%:itemprices::%{_nbr}%} to none
  24. remove {_koszt} of {@waluta} from {_buyer}
  25. send "&aSprzedano Przedmiot!" to {_seller}
  26. send "&aZakonczono transakcje!" to {_buyer}
  27. launch flickering trailing ball firework colored green at {_seller} timed 1
  28. else:
  29. send "{@tag} &cNie masz tyle zlota!" to {_buyer}
  30. function modal(n: integer, koszt: integer, seller: player, buyer: player):
  31. open chest with 4 rows named "&9Potwierdz" to {_buyer}
  32. wait 2 tick
  33. format slot 11 of {_buyer} with red stained glass named "&4Anuluj" to close
  34. set {_a} to {_n}
  35. set {_b} to {_koszt}
  36. set {_c} to {_seller}
  37. set {_d} to {_buyer}
  38. format slot 15 of {_buyer} with green stained glass named "&aKUP" to run [potwierdzZakup({_a}, {_b}, {_c}, {_d})]
  39. format slot 4 of {_buyer} with {@waluta} named "&6Waluta" to be unstealable
  40. set {_item} to {handel:%{_seller}%:itemlist::%{_n}%}
  41. format slot 22 of {_buyer} with {_item} with lore "&cCena: %{_koszt}%" to be unstealable
  42.  
  43.  
  44. function usunPrzedmiot(n: integer, gracz: player):
  45. give {handel:%{_gracz}%:itemlist::%{_n}%} to {_gracz}
  46. set {handel:%{_gracz}%:itemlist::%{_n}%} to none
  47. set {handel:%{_gracz}%:itemprices::%{_n}%} to none
  48. send "{@tag} &cUsunales przedmiot." to {_gracz}
  49. function powiekszSklep(gracz: player):
  50. set {_amount} to number of {@waluta} in {_gracz}'s inventory
  51. if {_gracz} has permission "{@vipPerm}":
  52. set {_c} to {@cenaV}
  53. else:
  54. set {_c} to {@cena}
  55. set {_x} to {_c} * {@startoweLinijki}
  56. set {_l} to {handel::%{_gracz}%::iloscLinii} + 1
  57. set {_cen} to {_l} * {_c}
  58. set {_cena} to {_cen} - {_x}
  59. if {_amount} is greater or equal to {_cena}:
  60.  
  61. if {handel::%{_gracz}%::iloscLinii} is less than {@maxLinijek}:
  62. add 1 to {handel::%{_gracz}%::iloscLinii}
  63. remove {_cena} of {@waluta} from {_gracz}
  64. send "{@tag} &aDokupiles dodatkowa linijke do sklepu. Aktualnie masz %{handel::%{_gracz}%::iloscLinii}% linijek!" to {_gracz}
  65. close {_gracz}'s inventory
  66. else:
  67. send "{@tag} &cPosiadasz maksymalna ilosc linijek w sklepie." to {_gracz}
  68. else:
  69. send "{@tag} &cNie posiadasz tyle zlota!" to {_gracz}
  70. command /sklep [<text="pomoc">] [<text>] [<text>] [<text>]:
  71. trigger:
  72. if arg 1 is "pomoc":
  73. send "{@tag}"
  74. send "&7/sklep pomoc &6- Pomoc"
  75. send "&7/sklep zaloz <Nazwa Sklepu> &6- Dodaje Sklep"
  76. send "&7/sklep usun &6- Usuwa Sklep"
  77. send "&7/sklep ditem <Cena Przedmiotu> &6- Dodaje item do sklepu"
  78. send "&7/sklep uitem &6- Usuwanie Przedmiotow"
  79. send "&7/sklep otworz &6- Otwiera Sklep"
  80. send "&7/sklep zamknij &6- Zamyka Sklep"
  81. send "&7/sklep podglad &6- Podglad Sklepu"
  82. send "&7/sklep powieksz &6- Powiekszenie Sklepu za zloto"
  83. send "{@tag}"
  84. if arg 1 is "zaloz":
  85. if distance between {handel::miejsce} and location of player is less than {@promien}:
  86. if {handel:%player%:open} is true:
  87. send "{@tag} &cPosiadasz juz sklep"
  88. stop
  89. if {handel:%player%:open} is false:
  90. set {handel:%player%:open} to true
  91. set {handel:%player%:otwarty} to false
  92. send "{@tag} &aUtworzyles sklep!"
  93. send "{@tag} &7Nie jest on jeszcze otwarty, aby go otworzyć wpisz: "
  94. send "{@tag} &6/sklep otworz"
  95. apply Slowness 99 to the player for 999 days
  96. set {_y} to player's y-coordinate + 1.25
  97. set {_loc} to location at player's x-coordinate, {_y}, player's z-coordinate of the world world of player
  98. new Hologram "%player's name%";
  99. if player has permission "{@vipPerm}":
  100. "%player's name%".Hologram.change{"&6Sklep gracza %name of player% (zamkniety)"};
  101. else:
  102. "%player's name%".Hologram.change{"&eSklep gracza %name of player% (zamkniety)"};
  103. "%player's name%".Hologram.show{{_loc}};
  104. stop
  105. else:
  106. send "{@tag} &cNie jestes w miejscu, w ktorym mozna zakladac sklep! &4(%{handel::miejsce}%)"
  107. stop
  108. if arg 1 is "usun":
  109. if {handel:%player%:open} is false:
  110. send "{@tag} &cNie posiadasz sklepu"
  111. stop
  112. if {handel:%player%:open} is true:
  113. set {handel:%player%:open} to false
  114. loop {handel:%player%:itemlist::*}:
  115. give loop-value to player
  116. clear {handel:%player%:itemlist::*}
  117. clear {handel:%player%:itemprices::*}
  118. set {handel:%player%:otwarty} to false
  119. send "{@tag} &cUsuneles sklep!"
  120. clear {sklep:%player%:nazwa}
  121. remove slowness from player
  122. "%player's name%".Hologram.delete{};
  123. stop
  124. if arg 1 is "ditem":
  125. if arg 2 is not set:
  126. send "{@tag} &cPoprawne uzycie! &4/sklep ditem <cena>"
  127. if arg 2 is set:
  128. if player's tool is air:
  129. send "{@tag} &cNie masz nic w rece!" to player
  130. stop
  131. if player's tool is {@waluta}:
  132. send "{@tag} &cNie mozesz sprzedac waluty!"
  133. stop
  134. if {handel:%player%:open} is false:
  135. send "{@tag} &cNie posiadasz Sklepu!"
  136. stop
  137. if {handel:%player%:open} is true:
  138. set {_converted} to arg 2 parsed as number
  139. if {_converted} is set:
  140. add player's tool to {handel:%player%:itemlist::*}
  141. add {_converted} to {handel:%player%:itemprices::*}
  142. remove player's tool from player
  143. send "{@tag} &aDodano przedmiot do sklepu!" to player
  144. else:
  145. send "{@tag} &cPodaj prawidlowa cene!"
  146. stop
  147. if arg 1 is "uitem":
  148. if {handel:%player%:open} is false:
  149. send "{@tag} &cNie posiadasz Sklepu"
  150. stop
  151. if {handel:%player%:open} is true:
  152. open chest with {handel:%player%:ilocs} rows named "&9&lUsuwanie przedmiotow..." to player
  153. wait 1 tick
  154. set {_slot} to 0
  155. loop {handel:%player%:itemlist::*}:
  156. set {_a} to loop-index parsed as integer
  157. set {_b} to player
  158. format slot {_slot} of player with loop-value to run [usunPrzedmiot({_a}, {_b})]
  159. wait 2 tick
  160. add 1 to {_slot}
  161. stop
  162. if arg 1 is "podglad":
  163. if {handel:%player%:open} is false:
  164. send "{@tag} &cNie posiadasz Sklepu"
  165. stop
  166. if {handel:%player%:open} is true:
  167. open chest with {handel::%player%::iloscLinii} rows named "&eSklep » &7%name of player%" to player
  168. set {_slot} to 0
  169. loop {handel:%player%:itemlist::*}:
  170. set {_item} to loop-value with lore "&cCena: %{handel:%player%:itemprices::%loop-index%}%"
  171. format slot {_slot} of player with {_item} to be unstealable
  172. add 1 to {_slot}
  173. stop
  174. if arg 1 is "powieksz":
  175. if {handel::%player%::iloscLinii} is equal to {@maxLinijek}:
  176. send "{@tag} &aPosiadasz maksymalna ilosc linijek!"
  177. stop
  178. open chest with 3 rows named "&9&lPowieksz" to player
  179. wait 1 tick
  180. if player has permission "{@vipPerm}":
  181. set {_c} to {@cenaV}
  182. else:
  183. set {_c} to {@cena}
  184. set {_x} to {_c} * {@startoweLinijki}
  185. set {_l} to {handel::%player%::iloscLinii} + 1
  186. set {_cen} to {_l} * {_c}
  187. set {_cena} to {_cen} - {_x}
  188. format slot 10 of player with {handel::%player%::iloscLinii} of workbench named "&9&lPowieksz Sklep" with lore "&6Koszt&8: &7%{_cena}%" to run [powiekszSklep(player)]
  189. stop
  190. if arg 1 is "setsklepy":
  191. if player has permission "sklep.setmiejsce":
  192. set {handel::miejsce} to location of player
  193. send "{@tag} &aUstawiles miejsce zakladania sklepow"
  194. stop
  195. if arg 1 is "otworz":
  196. if {handel:%player%:open} is false:
  197. send "{@tag} &cNie posiadasz Sklepu"
  198. stop
  199. if {handel:%player%:open} is true:
  200. set {handel:%player%:otwarty} to true
  201. send "{@tag} &aTwoj sklep jest teraz otwarty!"
  202. send "{@tag} &7Aby go zamknac wpisz:"
  203. send "{@tag} &6/sklep zamknij"
  204. if player has permission "{@vipPerm}":
  205. "%player's name%".Hologram.change{"&6Sklep gracza %name of player%"};
  206. else:
  207. "%player's name%".Hologram.change{"&eSklep gracza %name of player%"};
  208. set {_y} to player's y-coordinate + 1.25
  209. set {_loc} to location at player's x-coordinate, {_y}, player's z-coordinate of the world world of player
  210. "%player's name%".Hologram.show{{_loc}}
  211. if arg 1 is "zamknij":
  212. if {handel:%player%:open} is false:
  213. send "{@tag} &cNie posiadasz Sklepu"
  214. stop
  215. if {handel:%player%:open} is true:
  216. set {handel:%player%:otwarty} to false
  217. send "{@tag} &cTwoj sklep jest teraz zamkniety!"
  218. if player has permission "{@vipPerm}":
  219. "%player's name%".Hologram.change{"&6Sklep gracza %name of player% (zamkniety)"};
  220. else:
  221. "%player's name%".Hologram.change{"&eSklep gracza %name of player% (zamkniety)"};
  222. set {_y} to player's y-coordinate + 1.25
  223. set {_loc} to location at player's x-coordinate, {_y}, player's z-coordinate of the world world of player
  224. "%player's name%".Hologram.show{{_loc}}
  225. if arg 1 is not "zaloz" or "usun" or "ditem" or "uitem" or "podglad" or "powieksz" or "pomoc" or "otworz" or "zamknij":
  226. send "{@tag} &cNieznana komenda! &4/sklep"
  227. stop
  228.  
  229. on jump:
  230. if {handel:%player%:open} is true:
  231. cancel event
  232.  
  233. on quit:
  234. if {handel:%player%:open} is true:
  235. execute player command "sklep usun"
  236. on kick:
  237. if {handel:%player%:open} is true:
  238. execute player command "sklep usun"
  239.  
  240. on rightclick on player:
  241. if {handel:%target player%:open} is true:
  242. if {handel:%target player%:otwarty} is false:
  243. send "{@tag} &eTen sklep jest zamkniety!"
  244. stop
  245. open chest with {handel::%target player%::iloscLinii} rows named "&eSklep » &7%name of target player%" to player
  246. wait 2 tick
  247. set {_slot} to 0
  248. loop {handel:%target player%:itemlist::*}:
  249. set {_item} to loop-value with lore "&cCena: %{handel:%target player%:itemprices::%loop-index%}%"
  250. set {_a} to loop-index parsed as integer
  251. set {_b} to {handel:%target player%:itemprices::%loop-index%}
  252. set {_c} to target player
  253. set {_d} to player
  254. format slot {_slot} of player with {_item} to run [modal({_a}, {_b}, {_c}, {_d})]
  255. wait 2 tick
  256. add 1 to {_slot}
  257.  
  258. on join:
  259. if {handel::%player%::iloscLinii} is not set:
  260. set {handel::%player%::iloscLinii} to {@startoweLinijki}
  261.  
  262. every 1 minute:
  263. loop all players:
  264. if {handel:%loop-player%:open} is true:
  265. if {handel:%loop-player%:otwarty} is false:
  266. send "{@tag} &7Twoj sklep nie jest jeszcze otwarty, aby go otworzyć wpisz: " to loop-player
  267. send "{@tag} &6/sklep otworz" to loop-player
Advertisement
Add Comment
Please, Sign In to add comment