knugi

TradeSK - Handel w GUI (Minecraft)

Feb 25th, 2017
167
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 19.04 KB | None | 0 0
  1. command /handel [<text>] [<text>] [<text>]:
  2. trigger:
  3. if arg 1 is not set:
  4. send "&0##=##"
  5. send "&7Komendy wymiany:"
  6. send "&a/handel <gracz> &7- Tworzysz/akceptujesz wymiane z graczem."
  7. send "&a/handel odrzuc &7- Odrzucasz wymiane z graczem."
  8. send "&a/handel odbierz &7- Odbierasz przedmioty z depozytu."
  9. send "&a/handel banknot <integer> &7- tworzysz banknot"
  10. stop
  11. if arg 1 is "banknot":
  12. if arg 2 is set:
  13. set {_int} to "%arg 2%" parsed as integer
  14. if {_int} is integer:
  15. if player's balance is larger than or equal to {_int}:
  16. if player has enough space for 1 paper of unbreaking 1 named "&aBanknot" with lore "&6Nominal:||&c%{_int}%&a$":
  17. give paper of unbreaking 1 named "&aBanknot" with lore "&6Nominal:||&c%{_int}%&a$" to player
  18. remove {_int} from player's balance
  19. send "&c* &7Stworzyles banknot o nominale: &c%{_int}%"
  20. stop
  21. send "&c* &7Nie masz miejsca w ekwipunku."
  22. stop
  23. send "&c* &7Nie masz tyle pieniedzy. &8(&6Stan: &3%player's balance%&8}"
  24. stop
  25. send "&c* &7Podaj liczbe calkowita."
  26. stop
  27. send "&c* &7Banknot, to jest waluta, ktorej mozesz uzywac podczas wymiany.%nl%&7Klikajac prawym na banknot, przywracasz pieniadze do konta."
  28. stop
  29.  
  30. if arg 1 is "odrzuc":
  31. if {wymiana::%player%.status} is "oczekiwanie" or "gotowy":
  32. if {wymiana::%{wymiana::%player%.with}%.status} is "oczekiwanie" or "gotowy":
  33. send "&c* &7Gracz &6%player% &7odrzucil wymiane z toba." to {wymiana::%player%.with}
  34. send "&c* &7Anulowales wymiane z graczem: &6%{wymiana::%player%.with}%"
  35. clear {wymiana::%{wymiana::%player%.with}%.with}
  36. clear {wymiana::%player%.with}
  37. clear {wymiana::%player%.status}
  38. clear {wymiana::%{wymiana::%player%.with}%.status}
  39. stop
  40. if arg 1 is "odbierz":
  41. if {wymiana::%player%.deposit::*} is set:
  42. loop {wymiana::%player%.deposit::*}:
  43. if player has enough space for loop-value:
  44. give loop-value to player
  45. remove loop-value from {wymiana::%player%.deposit::*}
  46. send "&c* &7Prosze, odbierz swoje przedmioty."
  47. stop
  48. if arg 1 is "break":
  49. if sender is console:
  50. set {_player} to "%arg 2%" parsed as offlineplayer
  51. set {_player2} to "%arg 3%" parsed as offlineplayer
  52. clear {wymiana::%{_player}%.status}
  53. clear {wymiana::%{_player2}%.status}
  54. clear {wymiana::%{_player}%.with}
  55. clear {wymiana::%{_player2}%.with}
  56. clear {wymiana::%{_player}%.trial}
  57. clear {wymiana::%{_player2}%.trial}
  58. if "%inventory name of {_player2}'s current inventory%" contains "Wymiana z graczem":
  59. set {_i} to 0
  60. loop 18 times:
  61. if {_player2}'s current inventory's slot {_i} is not air:
  62. give {_player2}'s current inventory's slot {_i} to {_player2}
  63. close {_player2}'s inventory
  64. loop {wymiana::%{_player2}%.items::*}:
  65. give loop-value to {_player2}
  66. clear {wymiana::%{_player}%.items::*}
  67. clear {wymiana::%{_player2}%.items::*}
  68. stop
  69. set {_arg} to "%arg 1%" parsed as offlineplayer
  70. if {_arg} is player:
  71. send "&c* &7Nie mozesz przeprowadzic handlu z samym soba."
  72. stop
  73. if {_arg} is online:
  74. if distance between player and {_arg} is smaller than 5.1:
  75. if "%all items in player's inventory%" is "<none>":
  76. send "&c* &7Masz puste eq."
  77. stop
  78. if {wymiana::%{_arg}%.status} is not set:
  79. set {wymiana::%{_arg}%.status} to "oczekiwanie"
  80. set {wymiana::%player%.status} to "gotowy"
  81. set {wymiana::%{_arg}%.with} to player
  82. set {wymiana::%player%.with} to {_arg}
  83. set {wymiana::%player%.expire} to 15
  84. set {wymiana::%{_arg}%.expire} to 15
  85. send "&c* &7Wyslales prosbe o handel do gracza: &6%{_arg}%" to player
  86. send "&c* &7Gracz: &6%player% &7wyslal prosbe do Ciebie o handel.%nl%&7Wpisz: &6/handel %player%" to {_arg}
  87. stop
  88. if {wymiana::%{_arg}%.status} is "gotowy":
  89. if {wymiana::%{_arg}%.with} is player:
  90. close {_arg}'s inventory
  91. clear {wymiana::%player%.expire}
  92. clear {wymiana::%{_arg}%.expire}
  93. wait 2 tick
  94. open chest with 2 rows named "&6Wymiana z graczem: &r%{_arg}%" to player
  95. open chest with 2 rows named "&6Wymiana z graczem: &r%player%" to {_arg}
  96. send "&c* &7Wloz przedmioty ktore chcesz dac dla gracza: &c%{_arg}%" to player
  97. send "&c* &7Wloz przedmioty ktore chcesz dac dla gracza: &c%player%" to {_arg}
  98. set {wymiana::%player%.status} to "setting"
  99. set {wymiana::%{_arg}%.status} to "setting"
  100. stop
  101. send "&c* &7Ten gracz juz zaprosil kogos do handlu.%nl%&7Wygasnie za: &c%{wymiana::%{_arg}%.expire}% sekund."
  102. stop
  103. if {wymiana::%{_arg}%.status} is "oczekiwanie":
  104. send "&c* &7Ten gracz juz dostal zaproszenie do handlu.%nl%&7Wygasnie za: &c%{wymiana::%{_arg}%.expire}% sekund."
  105. stop
  106. else:
  107. send "&c* &7Ten gracz juz prowadzi wymiane."
  108. stop
  109. send "&c* &7Ten gracz nie jest kolo Ciebie."
  110. stop
  111. send "&c* &7Tego gracza nie ma na serwerze lub nie masz nic w depozycie albo nie dostales zaproszenia."
  112. stop
  113. every 1 second:
  114. loop all players:
  115. if {wymiana::%loop-player%.debug} is set:
  116. clear {wymiana::%loop-player%.debug}
  117. if {wymiana::%loop-player%.expire} is larger than 0:
  118. remove 1 from {wymiana::%loop-player%.expire}
  119. else if {wymiana::%loop-player%.expire} is 0:
  120. clear {wymiana::%{wymiana::%loop-player%.with}%.expire}
  121. clear {wymiana::%{wymiana::%loop-player%.with}%.status}
  122. clear {wymiana::%{wymiana::%loop-player%.with}%.with}
  123. clear {wymiana::%loop-player%.expire}
  124. clear {wymiana::%loop-player%.status}
  125. clear {wymiana::%loop-player%.with}
  126. on rightclick with paper:
  127. if name of player's tool is "&aBanknot":
  128. set {_lore::*} to lore of player's tool split at "||"
  129. set {_int} to "%uncoloured {_lore::2}%"
  130. replace all "$" in {_int} with ""
  131. set {_int} to {_int} parsed as integer
  132. add {_int} to player's balance
  133. remove paper of unbreaking 1 named "&aBanknot" with lore "%lore of player's tool%" from player
  134. send "&c* &7Otrzymales &6%{_int}%$ &7z banknotu."
  135. stop
  136. stop
  137. on quit:
  138. if {wymiana::%player%.status} is "setting" or "waiting" or "accept":
  139. set {_player2} to {wymiana::%player%.with}
  140. clear {wymiana::%{_player2}%.with}
  141. if {wymiana::%{_player2}%.status} is "setting":
  142. set {_i} to 0
  143. loop 18 times:
  144. if {_player2}'s current inventory's slot {_i} is not air:
  145. give {_player2}'s current inventory's slot {_i} to {_player2}
  146. add 1 to {_i}
  147. clear {wymiana::%{_player2}%.items}
  148. else:
  149. loop {wymiana::%{_player2}%.items::*}:
  150. give loop-value to {_player2}
  151. clear {wymiana::%{_player2}%.items::%loop-index%}
  152. clear {wymiana::%{_player2}%.status}
  153. close {_player2}'s inventory
  154. send "&c* &7Gracz &6%player% &7wyszedl z gry." to {_player2}
  155. if {wymiana::%player%.status} is "waiting" or "accept":
  156. loop {wymiana::%player%.items::*}:
  157. add loop-value to {wymiana::%player%.deposit::*}
  158. clear {wymiana::%player%.items::%loop-index%}
  159. stop
  160. if "%inventory name of player's current inventory%" contains "Wymiana z graczem":
  161. set {_i} to 0
  162. loop 18 times:
  163. if player's current inventory's slot {_i} is not air:
  164. add player's current inventory's slot {_i} to {wymiana::%player%.deposit::*}
  165. add 1 to {_i}
  166. stop
  167. set {_player} to player
  168. set {_player2} to {wymiana::%player%.with}
  169. clear {wymiana::%{_player}%.status}
  170. clear {wymiana::%{_player2}%.status}
  171. clear {wymiana::%{_player}%.with}
  172. clear {wymiana::%{_player2}%.with}
  173. clear {wymiana::%{_player}%.trial}
  174. clear {wymiana::%{_player2}%.trial}
  175. on inventory click:
  176. if "%inventory name of player's current inventory%" contains "Status handlu":
  177. if slot is smaller than 0:
  178. stop
  179. cancel event
  180. #Zmien itemy..
  181. if player's current inventory's slot slot is brown glass:
  182. if name of player's current inventory's slot slot is "&6&lZmien przedmioty":
  183. set {wymiana::%player%.status} to "setting"
  184. wait 2 tick
  185. close player's inventory
  186. wait 2 tick
  187. open chest with 2 rows named "&6Wymiana z graczem: &r%{wymiana::%player%.with}%" to player
  188. wait 2 tick
  189. set {_i} to 0
  190. loop 18 times:
  191. if {wymiana::%player%.items::%loop-number%} is not air:
  192. set player's current inventory's slot {_i} to {wymiana::%player%.items::%loop-number%}
  193. add 1 to {_i}
  194. clear {wymiana::%player%.items::*}
  195. if {wymiana::%{wymiana::%player%.with}%.status} is "waiting" or "accept":
  196. set {_i} to 50
  197. loop 4 times:
  198. set {wymiana::%player%.with}'s current inventory's slot {_i} to yellow glass named "&6&lStatus" with lore "&6Gracz %player%:||&c* &aUstawia swoje przedmioty"
  199. add 1 to {_i}
  200. set {_i} to 5
  201. loop 18 times:
  202. set {wymiana::%player%.with}'s current inventory's slot {_i} to air
  203. if "%loop-number / 4%" contains "." or ",":
  204. add 1 to {_i}
  205. else:
  206. add 6 to {_i}
  207. stop
  208. #Accept
  209. if player's current inventory's slot slot is light green glass:
  210. if name of player's current inventory's slot slot is "&a&lZatwierdz":
  211. set {wymiana::%player%.status} to "accept"
  212. if {wymiana::%{wymiana::%player%.with}%.status} is "accept":
  213. #Kod na wysylanie itemow.
  214. send "&c* &aPomyslnie wymieniles przedmioty z: &c%{wymiana::%player%.with}%" to player
  215. send "&c* &aPomyslnie wymieniles przedmioty z: &c%player%" to {wymiana::%player%.with}
  216. set {_player} to {wymiana::%player%.with}
  217. loop {wymiana::%player%.items::*}:
  218. if {_player} has enough space for loop-value:
  219. add loop-value to {_player}
  220. else:
  221. add loop-value to {wymiana::%{_player}%.deposit::*}
  222. send "&c* &7Dodano &6%loop-value% &7do depozytu." to {_player}
  223. clear {wymiana::%player%.items::%loop-index%}
  224. loop {wymiana::%{_player}%.items::*}:
  225. if player has enough space for loop-value:
  226. add loop-value to player
  227. else:
  228. add loop-value to {wymiana::%player%.deposit::*}
  229. send "&c* &7Dodano &6%loop-value% &7do depozytu." to player
  230. clear {wymiana::%{_player}%.items::%loop-index%}
  231. clear {wymiana::%player%.status}
  232. clear {wymiana::%{wymiana::%player%.with}%.status}
  233. close player's inventory
  234. close {wymiana::%player%.with}'s inventory
  235. execute console command "handel break %player% %{wymiana::%player%.with}%"
  236. stop
  237. set player's current inventory's slot 46 to light green glass named "&6&lTwoj status" with lore "&aAkceptujesz"
  238. if {wymiana::%{wymiana::%player%.with}%.status} is "waiting":
  239. set {_i} to 50
  240. loop 4 times:
  241. set {wymiana::%player%.with}'s current inventory's slot {_i} to light green glass named "&6&lStatus" with lore "&6Gracz %player%:||&c* &aZaakceptowal wymiane"
  242. add 1 to {_i}
  243. #status = {"gotowy", "oczekiwanie", "waiting", "setting", "accept"}
  244. #Odrzuc
  245. if player's current inventory's slot slot is red glass:
  246. if name of player's current inventory's slot slot is "&c&lOdrzuc":
  247. send "&c* &7Gracz &6%player% &7odrzucil wymiane z Toba." to {wymiana::%player%.with}
  248. send "&c* &7Anulowales wymiane z graczem &6%{wymiana::%player%.with}%" to player
  249. loop {wymiana::%player%.items::*}:
  250. if player has enough space for loop-value:
  251. add loop-value to player
  252. else:
  253. add loop-value to {wymiana::%player%.deposit::*}
  254. send "&c* &7Dodano &6%loop-value% &7do depozytu." to player
  255. remove loop-value from {wymiana::%player%.items::*}
  256. loop {wymiana::%{wymiana::%player%.with}%.items::*}:
  257. if {wymiana::%player%.with} has enough space for loop-value:
  258. add loop-value to {wymiana::%player%.with}
  259. else:
  260. add loop-value to {wymiana::%{wymiana::%player%.with}%.deposit::*}
  261. send "&c* &7Dodano &6%loop-value% &7do depozytu." to {wymiana::%player%.with}
  262. remove loop-value from {wymiana::%{wymiana::%player%.with}%.items::*}
  263. clear {wymiana::%{wymiana::%player%.with}%.status}
  264. clear {wymiana::%{wymiana::%player%.with}%.with}
  265. clear {wymiana::%{wymiana::%player%.with}%.items::*}
  266. clear {wymiana::%player%.status}
  267. close {wymiana::%player%.with}'s inventory
  268. clear {wymiana::%player%.with}
  269. clear {wymiana::%player%.items::*}
  270. close player's inventory
  271.  
  272. on inventory close:
  273. if "%inventory name of player's current inventory%" contains "Wymiana z graczem":
  274. if {wymiana::%player%.status} is "setting":
  275. set {_i} to 0
  276. loop 18 times:
  277. if player's current inventory's slot {_i} is not air:
  278. add player's current inventory's slot {_i} to {wymiana::%player%.items::*}
  279. set {_exists} to true
  280. add 1 to {_i}
  281. if {_exists} is not set:
  282. if {wymiana::%player%.trial} is not set:
  283. set {wymiana::%player%.trial} to 1
  284. else:
  285. add 1 to {wymiana::%player%.trial}
  286. send "&c* &7Musisz cos dac dla gracza. &8(&c%{wymiana::%player%.trial}%/3&8)"
  287. if {wymiana::%player%.trial} is larger than or equal to 3:
  288. send "&c* &7Gracz %player% &7zakonczyl wymiane z toba." to {wymiana::%player%.with}
  289. send "&c* &7Zakonczyles wymiane z &6%{wymiana::%player%.with}%" to player
  290. execute console command "handel break %player% %{wymiana::%player%.with}%"
  291. stop
  292. wait 2 tick
  293. open chest with 2 rows named "&6Wymiana z graczem: &r%{wymiana::%player%.with}%" to player
  294. stop
  295. wait 2 tick
  296. open chest with 6 rows named "&6Status handlu" to player
  297. wait 2 tick
  298. set {wymiana::%player%.status} to "waiting"
  299. set {_i} to 4
  300. loop 6 times:
  301. set player's current inventory's slot {_i} to blue glass named "&9Przedzialka" with lore "&6<< Twoje Przedmioty||||&6Przedmioty gracza %{wymiana::%player%.with}% >>"
  302. add 9 to {_i}
  303. set {_i} to 50
  304. if {wymiana::%{wymiana::%player%.with}%.status} is "accept":
  305. set {wymiana::%{wymiana::%player%.with}%.status} to "waiting"
  306. set {wymiana::%player%.with}'s current inventory's slot 46 to white glass named "&6&lTwoj status" with lore "&aCzekasz..."
  307. loop 4 times:
  308. if {wymiana::%{wymiana::%player%.with}%.status} is not "setting":
  309. set {wymiana::%player%.with}'s current inventory's slot {_i} to white glass named "&6&lStatus" with lore "&6Gracz %player%||&c* &aCzeka"
  310. if {wymiana::%{wymiana::%player%.with}%.status} is "setting":
  311. set player's current inventory's slot {_i} to yellow glass named "&6&lStatus" with lore "&6Gracz %{wymiana::%player%.with}%||&c* &aUstawia swoje itemy"
  312. if {wymiana::%{wymiana::%player%.with}%.status} is "waiting":
  313. set player's current inventory's slot {_i} to white glass named "&6&lStatus" with lore "&6Gracz %{wymiana::%player%.with}%||&c* &aCzeka"
  314. if {wymiana::%{wymiana::%player%.with}%.status} is "accept":
  315. set player's current inventory's slot {_i} to light green glass named "&6&lStatus" with lore "&6Gracz %{wymiana::%player%.with}%||&c* &aZaakceptowal wymiane"
  316. add 1 to {_i}
  317. add 1 to {_i}
  318. set player's current inventory's slot 48 to light green glass named "&a&lZatwierdz" with lore "&aKliknij aby:||&c* Zaakceptowac wymiane z graczem %{wymiana::%player%.with}%"
  319. set player's current inventory's slot 47 to red glass named "&c&lOdrzuc" with lore "&aKliknij aby:||&c*Odrzucic wymiane z graczem %{wymiana::%player%.with}%"
  320. set player's current inventory's slot 45 to brown glass named "&6&lZmien przedmioty" with lore "&aKliknij aby:||&c* Zmienic swoje przedmioty"
  321. set player's current inventory's slot 46 to white glass named "&6&lTwoj status" with lore "&aCzekasz..."
  322.  
  323. set {_i} to 0
  324. loop 18 times:
  325. set player's current inventory's slot {_i} to {wymiana::%player%.items::%loop-number%}
  326. if "%loop-number / 4%" contains "." or ",":
  327. add 1 to {_i}
  328. else:
  329. add 6 to {_i}
  330. if {wymiana::%{wymiana::%player%.with}%.status} is not "setting":
  331. set {_i} to 5
  332. loop 18 times:
  333. set {wymiana::%player%.with}'s current inventory's slot {_i} to {wymiana::%player%.items::%loop-number%}
  334. if "%loop-number / 4%" contains "." or ",":
  335. add 1 to {_i}
  336. else:
  337. add 6 to {_i}
  338. set {_i} to 5
  339. loop 18 times:
  340. set player's current inventory's slot {_i} to {wymiana::%{wymiana::%player%.with}%.items::%loop-number%}
  341. if "%loop-number / 4%" contains "." or ",":
  342. add 1 to {_i}
  343. else:
  344. add 6 to {_i}
  345. stop
  346. set {_i} to 0
  347. loop 18 times:
  348. if player's current inventory's slot {_i} is not air:
  349. give player's current inventory's slot {_i} to player
  350. add 1 to {_i}
  351.  
  352. on inventory close:
  353. if "%inventory name of player's current inventory%" contains "Status handlu":
  354. if {wymiana::%player%.status} is "waiting" or "accept":
  355. wait 2 tick
  356. open chest with 6 rows named "&6Status handlu" to player
  357. wait 2 tick
  358. set {wymiana::%player%.status} to "waiting"
  359. set {_i} to 4
  360. loop 6 times:
  361. set player's current inventory's slot {_i} to blue glass named "&9Przedzialka" with lore "&6<< Twoje Przedmioty||||&6Przedmioty gracza %{wymiana::%player%.with}% >>"
  362. add 9 to {_i}
  363. set {_i} to 50
  364. loop 4 times:
  365. if {wymiana::%{wymiana::%player%.with}%.status} is not "setting":
  366. set {wymiana::%player%.with}'s current inventory's slot {_i} to white glass named "&6&lStatus" with lore "&6Gracz %player%||&c* &aCzeka"
  367. if {wymiana::%{wymiana::%player%.with}%.status} is "setting":
  368. set player's current inventory's slot {_i} to yellow glass named "&6&lStatus" with lore "&6Gracz %{wymiana::%player%.with}%||&c* &aUstawia swoje itemy"
  369. if {wymiana::%{wymiana::%player%.with}%.status} is "waiting":
  370. set player's current inventory's slot {_i} to white glass named "&6&lStatus" with lore "&6Gracz %{wymiana::%player%.with}%||&c* &aCzeka"
  371. if {wymiana::%{wymiana::%player%.with}%.status} is "accept":
  372. set player's current inventory's slot {_i} to light green glass named "&6&lStatus" with lore "&6Gracz %{wymiana::%player%.with}%||&c* &aZaakceptowal wymiane"
  373. add 1 to {_i}
  374. add 1 to {_i}
  375. set player's current inventory's slot 48 to light green glass named "&a&lZatwierdz" with lore "&aKliknij aby:||&c* Zaakceptowac wymiane z graczem %{wymiana::%player%.with}%"
  376. set player's current inventory's slot 47 to red glass named "&c&lOdrzuc" with lore "&aKliknij aby:||&c*Odrzucic wymiane z graczem %{wymiana::%player%.with}%"
  377. set player's current inventory's slot 45 to brown glass named "&6&lZmien przedmioty" with lore "&aKliknij aby:||&c* Zmienic swoje przedmioty"
  378. set {_i} to 0
  379. loop 18 times:
  380. set player's current inventory's slot {_i} to {wymiana::%player%.items::%loop-number%}
  381. if "%loop-number / 4%" contains "." or ",":
  382. add 1 to {_i}
  383. else:
  384. add 6 to {_i}
  385. if {wymiana::%{wymiana::%player%.with}%.status} is not "setting":
  386. set {_i} to 5
  387. loop 18 times:
  388. set {wymiana::%player%.with}'s current inventory's slot {_i} to {wymiana::%player%.items::%loop-number%}
  389. if "%loop-number / 4%" contains "." or ",":
  390. add 1 to {_i}
  391. else:
  392. add 6 to {_i}
  393. set {_i} to 5
  394. loop 18 times:
  395. set player's current inventory's slot {_i} to {wymiana::%{wymiana::%player%.with}%.items::%loop-number%}
  396. if "%loop-number / 4%" contains "." or ",":
  397. add 1 to {_i}
  398. else:
  399. add 6 to {_i}
  400. #------------------------------------------------- TOPKA SKRYPTU -----------------------------------------------------#
Advertisement
Add Comment
Please, Sign In to add comment