Advertisement
nfell2009

Untitled

Mar 2nd, 2015
226
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 21.53 KB | None | 0 0
  1. options:
  2. P: &8[&aSS&8]&a # ShopSearch prefix
  3. MyC: &6[&eMyC&6]&e # MyConomy Prefix
  4. uMyC: [MyC] # MyConomy logging prefix
  5. # Curreny related stuff #
  6. B-C: true # Symbol before. Example: $1000. Set to false for: 1000$
  7. QuickShop: true # If true, when a user creates a shop they will be given a code which they can use in /ss quickshop <code>. REQUIRES CODEGENAPI!
  8. # To change the currency symbol just change the £ sign below to whatever.
  9.  
  10. on script load:
  11. set {ss.version} to "1.4.1"
  12. set {ss.currency} to "£" # Currency symbol.
  13. wait 1 second
  14. if {ss.codegenapi.key} is not set:
  15. if {cga.max} is set:
  16. execute console command "/codegenapi g k shopsearch"
  17. set {ss.codegenapi.key} to {cga.shopsearch.code}
  18.  
  19. on join:
  20. if {ss.%uuid of player%.exists} is not set:
  21. set {ss.%uuid of player%.exists} to true
  22. set {ss.%uuid of player%.buying} to false
  23. if {ss.%uuid of player%.lastplayer} is not set:
  24. set {ss.%uuid of player%.lastplayer} to player
  25. if {ss.playerlist::%player%} is not set:
  26. set {ss.playerlist::%player%} to player
  27. else if {ss.%uuid of player%.lastplayer} is not player:
  28. set {_p} to {ss.%uuid of player%.lastplayer} parsed as player
  29. loop {ss.%{_p}%.chests::*}:
  30. add loop-value to {ss.%player%.chests::*}
  31. set {_loc} to loop-value
  32. add 1 to y coord of {_loc}
  33. set line 1 of block at {_loc} to "%player%"
  34. delete {ss.%{_p}%.chests::*}
  35.  
  36.  
  37. every 10 seconds:
  38. $ thread
  39. set {ss.version} to text from url "http://nfell2009..uk/skript/ss-version.txt"
  40. set {_ver::*} to script split at "ShopSearch_v"
  41. set {_v} to {_ver::2} parsed as number
  42. if {ss.version} is less than {_v}:
  43. loop all players:
  44. loop-player has permission "ss.admin":
  45. send "{@P} ShopSearch is not on the latest version! your version &61.0&a. The new version is &6%{ss.version}%&a." to loop-player
  46.  
  47. command /ss-admin [<text>] [<text>] [<text>]:
  48. description: SearchShop Admin
  49. permission: shopsearch.admin
  50. trigger:
  51. if arg 1 is not set:
  52. message "{@P} Type /ss-admin help - for help"
  53. if arg 1 is "help":
  54. message "{@P} ShopSearch admin command help"
  55. message "{@P} /ss-admin delete <user> - Deletes a user's shops"
  56. message "{@P} /ss-admin clearall <user> - Removes the users shops AND the chest/sign blocks"
  57. message "{@P} /ss-admin convert <user from> <user to> - Converts a chest of a user to another's"
  58. else if arg 1 is "delete":
  59. if arg 2 is set:
  60. set {_p} to arg 2 parsed as player
  61. set {_uuid} to uuid of {_p}
  62. if {ss.%{_uuid}%.exists} is true:
  63. if {ss.%{_p}%.chests::*} is not empty:
  64. message "{@P} Deleted %{_p}%'s shops (%size of {ss.%{_p}%.chests::*}%)"
  65. delete {ss.%{_p}%.chests::*}
  66. else:
  67. message "{@P} %{_p}% has no shops"
  68. else:
  69. message "{@P} That user doesn't exist"
  70. else:
  71. message "{@P} You must provide a player's name to remove."
  72. else if arg 1 is "clearall":
  73. if arg 2 is set:
  74. set {_p} to arg 2 parsed as player
  75. set {_uuid} to uuid of {_p}
  76. if {ss.%{_uuid}%.exists} is true:
  77. if {ss.%{_uuid}%.chests::*} is not empty:
  78. loop {ss.%{_p}%.chests::*}:
  79. set {_loc} to loop-value
  80. set block at {_loc} to air
  81. add 1 to y coord of {_loc}
  82. set block at {_loc} to air
  83. add 1 to {_num}
  84. message "{@P} Cleared %{_p}%'s shops (%{_num}%/%size of {ss.%{_p}%.chests::*}%)"
  85. delete {ss.%{_p}%.chests::*}
  86. else:
  87. message "{@P} %{_p}% has no shops"
  88. else:
  89. message "{@P} That user doesn't exist"
  90. else:
  91. message "{@P} You must provide a players name to clear"
  92. else if arg 1 is "convert":
  93. if arg 2 is set:
  94. if arg 3 is set:
  95. message "{@P} Converting chests for: %arg 2% to %arg 3%"
  96. loop {ss.%arg 2%.chests::*}:
  97. add loop-value to {ss.%arg 3%.chests::*}
  98. set {_loc} to loop-value
  99. add 1 to y coord of {_loc}
  100. set line 1 of block at {_loc} to "%arg 3%"
  101. add 1 to {_num}
  102. message "{@P} Successfully converted chests from %arg 2% to %arg 3% (%{_num}%/%size of {ss.%arg 2%.chests::*}%/%size of {ss.%arg 3%.chests::*}%)"
  103. delete {ss.%arg 2%.chests::*}
  104.  
  105. command /ss-console [<text>] [<text>] [<text>] [<text>] [<text>] [<text>] [<text>]:
  106. executable by: console
  107. trigger:
  108. broadcast "watttt"
  109. broadcast "%arg 1%"
  110. if arg 1 is "menu":
  111. set {_p} to arg 2 parsed as player
  112. set {_u} to uuid of {_p}
  113. send "{@P} We're preparing your shopping experience..." to {_p}
  114. set {ss.%{_u}%.buying.chestloc} to arg 7
  115. set {ss.%{_u}%.buying.playerto} to arg 3
  116. set {ss.%{_u}%.buying.amount} to arg 4
  117. set {ss.%{_u}%.buying.price} to arg 5
  118. set {ss.%{_u}%.buying.item} to arg 6
  119. set {ss.%{_u}%.buying} to true
  120. make {_p} execute command "/ss buy"
  121. else if arg 1 is "quickshop":
  122. set {_p} to arg 2 parsed as player
  123. set {_c} to arg 3
  124. make {_p} execute command "/ss quickshop %{_c}%"
  125. else:
  126. set {_p} to arg 2 parsed as player
  127. message "{@P} There was an error" to {_p}
  128.  
  129.  
  130. command /shopsearch [<text>] [<text>] [<item>]:
  131. description: Main ShopSearch command
  132. permission: shopsearch.usage
  133. aliases: /ss, /searchs, /sshop,
  134. trigger:
  135. if arg 1 is not set:
  136. message "{@P} You must give a subcommand!"
  137. else if arg 1 is "menu":
  138. if arg 2 is set:
  139. set {_p} to "%arg 2%" parsed as player
  140. set {_u} to uuid of {_p}
  141. set {_size} to rounded up size of {ss.%{_p}%.chests::*} / 9
  142. open chest with {_size} rows named "&aShop of: %{_p}%" to player
  143. wait 1 tick
  144. set {_num} to -3
  145. loop {ss.%{_p}%.chests::*}:
  146. add 1 to {_num}
  147. set {_loc} to location of block above block at loop-value
  148. set {_cloc} to location of block at loop-value
  149. set {_b} to block at {_loc}
  150. set {_i} to line 4 of {_b} parsed as item
  151. set {_a} to line 2 of {_b} parsed as integer
  152. if block at {_cloc} contains {_a} of {_i}:
  153. if {ss.quickshop.%{_cloc}%} is set:
  154. if line 1 of {_b} is "[Chest Shop]":
  155. format slot {_num} of player with {_i} named "&aIn stock" with lore "&aPlayer to: %{McCS.Owner.%{_loc}%}%||&aAmount: %line 2 of {_b}%||&aPrice: %line 3 of {_b}%||&aItem: %line 4 of {_b}%||&aQuickShop Code: %{ss.quickshop.%{_cloc}%}%" to close then run "ss-console quickshop %player% %{ss.quickshop.%{_cloc}%}%"
  156. else:
  157. format slot {_num} of player with {_i} named "&aIn stock" with lore "&aPlayer to: %line 1 of {_b}%||&aAmount: %line 2 of {_b}%||&aPrice: %line 3 of {_b}%||&aItem: %line 4 of {_b}%||&aQuickShop Code: %{ss.quickshop.%{_cloc}%}%" to close then run "ss-console quickshop %player% %{ss.quickshop.%{_cloc}%}%"
  158. else:
  159. if line 1 of {_b} is "[Chest Shop]":
  160. format slot {_num} of player with {_i} named "&aIn stock" with lore "&aPlayer to: %{McCS.Owner.%{_loc}%}%||&aAmount: %line 2 of {_b}%||&aPrice: %line 3 of {_b}%||&aItem: %line 4 of {_b}%" to close then run "ss-console menu %player% %arg 2% %line 2 of {_b}% %line 3 of {_b}% %line 4 of {_b}% %{_cloc}%"
  161. else:
  162. format slot {_num} of player with {_i} named "&aIn stock" with lore "&aPlayer to: %line 1 of {_b}%||&aAmount: %line 2 of {_b}%||&aPrice: %line 3 of {_b}%||&aItem: %line 4 of {_b}%" to close then run "ss-console menu %player% %arg 2% %line 2 of {_b}% %line 3 of {_b}% %line 4 of {_b}% %{_cloc}%"
  163. else:
  164. format slot {_num} of player with {_i} named "&4Out of stock" with lore "&4Unfortunately this item is currently out of stock" to be unstealable
  165. else if arg 1 is "quickshop":
  166. if arg 2 is set:
  167. if {ss.quickshop.%arg 2%} is set:
  168. set {_c} to arg 2
  169. set {_loc} to {ss.quickshop.%{_c}%}
  170. add 1 to y coord of {_loc}
  171. set {ss.%uuid of player%.buying.chestloc} to {ss.quickshop.%{_c}%}
  172. set {ss.%uuid of player%.buying.playerto} to {ss.quickshop.details.%{_c}%::playerto}
  173. set {ss.%uuid of player%.buying.amount} to {ss.quickshop.details.%{_c}%::amount}
  174. set {ss.%uuid of player%.buying.price} to {ss.quickshop.details.%{_c}%::price}
  175. set {ss.%uuid of player%.buying.item} to {ss.quickshop.details.%{_c}%::item}
  176. set {ss.%uuid of player%.buying} to true
  177. message "{@P} We have prepared your QuickShop!"
  178. make player execute command "/ss buy"
  179. else:
  180. message "{@P} Invalid code"
  181. else:
  182. message "{@P} You must provide a code"
  183. else if arg 1 is "stats":
  184. if arg 2 is "help":
  185. message "{@P} Stats help:"
  186. message "{@P} /ss stats shops - Lists number of shops"
  187. message "{@P} /ss stats money - Total money that has been sent in SS"
  188. message "{@P} /ss stats items - Best selling items"
  189. message "{@P} /ss ststs users - Most selling users"
  190. if arg 2 is "shops":
  191. loop {ss.playerlist::*}:
  192. add size of {ss.%loop-value%.chests::*} to {_count}
  193. if {_count} is not set:
  194. set {_count} to 0
  195. message "{@P} There are currently: %{_count}% shops!"
  196. else if arg 2 is "money":
  197. if {ss.totalmoney} is not set:
  198. set {ss.totalmoney} to 0
  199. if {@B-C} is true:
  200. message "{@P} A total of: %{ss.currency}%%{ss.totalmoney}% has been sent using ShopSearch"
  201. else:
  202. message "{@P} A total of: %{ss.totalmoney}%%{ss.currency}% has been sent using ShopSearch"
  203. else if arg 2 is "items":
  204. if {ss.itemlist-itm::*} is empty:
  205. message "{@P} There are no top selling items."
  206. stop
  207. else if {ss.itemlist-itm::*} is not set:
  208. message "{@P} There are no top selling items."
  209. stop
  210. message "{@P} Top selling items:"
  211. loop {ss.itemlist-itm::*}:
  212. add 1 to {_num}
  213. set {_item-%{_num}%} to {ss.itemlist-num::%loop-value%}
  214. if {_num} = 10:
  215. exit
  216. loop {ss.itemlist-itm::*}:
  217. loop 10 times:
  218. add 1 to {_cou}
  219. if {ss.itemlist-num::%loop-value%} > {_item-%{_num}%}:
  220. set {_output-list::%{_num}%} to "%loop-value% - %{ss.itemlist-num::%loop-value%}%"
  221. loop {_output-list::*}:
  222. message "{@P} %loop-value%"
  223. else if arg 2 is "users":
  224. if {ss.playersales-p::*} is empty:
  225. message "{@P} There are no top selling players."
  226. stop
  227. else if {ss.playersales-n::*} is not set:
  228. message "{@P} There are no top selling players."
  229. stop
  230. message "{@P} Top selling players:"
  231. loop {ss.playersales-p::*}:
  232. add 1 to {_num}
  233. set {_item-%{_num}%} to {ss.playersales-p::%loop-value%}
  234. if {_num} = 10:
  235. exit
  236. loop {ss.playersales-p::*}:
  237. loop 10 times:
  238. add 1 to {_cou}
  239. if {ss.playersales-n::%loop-value%} > {_item-%{_num}%}:
  240. set {_output-list::%{_num}%} to "%loop-value% - %{ss.playersales-n::%loop-value%}%"
  241. loop {_output-list::*}:
  242. message "{@P} %loop-value%"
  243. else if arg 1 is "add":
  244. message "{@P} Right click to add a chest!"
  245. set {ss.%uuid of player%.add} to true
  246. else if arg 1 is "remove":
  247. message "{@P} Right click to remove a chest!"
  248. set {ss.%uuid of player%.remove} to true
  249. else if arg 1 is "buy":
  250. if {ss.%uuid of player%.buying} is false:
  251. message "{@P} You haven't selected anything to buy!"
  252. else if {ss.%uuid of player%.buying} is true:
  253. message "{@P} Your selected purchase is as follows:"
  254. message "{@P} Item: %{ss.%uuid of player%.buying.item}%"
  255. message "{@P} Amount: %{ss.%uuid of player%.buying.amount}%"
  256. if {myc.enabled} is true:
  257. if {_price} is greater than 1:
  258. message "{@P} Price: %{ss.%uuid of player%.buying.price}%%{myc.currency.plural}%"
  259. else:
  260. message "{@P} Price: %{ss.%uuid of player%.buying.price}%%{myc.currency}%"
  261. else:
  262. message "{@P} Price: %{ss.%uuid of player%.buying.price}%"
  263. message "{@P} From Player: %{ss.%uuid of player%.buying.playerto}%"
  264. message "{@P} To confirm your purchase please do: /ss confirm"
  265. else:
  266. message "{@P} Something went wrong..."
  267. else if arg 1 is "confirm":
  268. if {ss.%uuid of player%.buying} is true:
  269. if block at {ss.%uuid of player%.buying.chestloc} contains {ss.%uuid of player%.buying.amount} of {ss.%uuid of player%.buying.item}:
  270. set {_number-of-items} to arg 2 parsed as number
  271. if {myc.enabled} is true:
  272. execute op command "/myc-transaction normal ShopSearch %player% %{ss.%uuid of player%.buying.playerto}% %{ss.%uuid of player%.buying.price}%"
  273. if {myc.%uuid of player%.tcomplete} is true:
  274. set {myc.%player%.tcomplete} to false
  275. remove {ss.%uuid of player%.buying.amount} of {ss.%uuid of player%.buying.item} from block at {ss.%uuid of player%.buying.chestloc}
  276. give {ss.%uuid of player%.buying.amount} of {ss.%uuid of player%.buying.item} to player
  277. subtract {ss.%uuid of player%.buying.price} from {myc.%uuid of player%.money}
  278. add {ss.%uuid of player%.buying.price} to {myc.%{ss.%uuid of player%.buying.playerto}%.money}
  279. message "{@P} You bought: %{ss.%uuid of player%.buying.amount}% %{ss.%uuid of player%.buying.item}%"
  280. if {ss.itemlist-itm::%{ss.%uuid of player%.buying.item}%} is not set:
  281. set {ss.itemlist-itm::%{ss.%uuid of player%.buying.item}%} to {ss.%uuid of player%.buying.item}
  282. set {ss.itemlist-num::%{ss.%uuid of player%.buying.item}%} to 1
  283. else:
  284. add 1 to {ss.itemlist-num::%{ss.%uuid of player%.buying.item}%}
  285. if {ss.playersales-p::%{ss.%uuid of player%.buying.playerto}%} is not set:
  286. set {ss.playersales-p::%{ss.%uuid of player%.buying.playerto}%} to {ss.%uuid of player%.buying.playerto}
  287. set {ss.playersales-n::%{ss.%uuid of player%.buying.playerto}%} to 1
  288. else:
  289. add 1 to {ss.playersales-n::%{ss.%uuid of player%.buying.playerto}%}
  290. add {ss.%uuid of player%.buying.price} to {ss.totalmoney}
  291. set {ss.%uuid of player%.buying} to false
  292. delete {ss.%uuid of player%.buying.chestloc}
  293. delete {ss.%uuid of player%.buying.item}
  294. delete {ss.%uuid of player%.buying.amount}
  295. delete {ss.%uuid of player%.buying.price}
  296. delete {ss.%uuid of player%.buying.playerto}
  297. else:
  298. message "{@P} Transaction failed. Please try again."
  299. else if {pp::setting::running} is true:
  300. if {pp::player::%uuid of player%::balance} is greater than or equal to {_price}:
  301. if {ss.itemlist-itm::%{ss.%uuid of player%.buying.item}%} is not set:
  302. set {ss.itemlist-itm::%{ss.%uuid of player%.buying.item}%} to {ss.%uuid of player%.buying.item}
  303. set {ss.itemlist-num::%{ss.%uuid of player%.buying.item}%} to 1
  304. else:
  305. add 1 to {ss.itemlist-num::%{ss.%uuid of player%.buying.item}%}
  306. if {ss.playersales-p::%{ss.%uuid of player%.buying.playerto}%} is not set:
  307. set {ss.playersales-p::%{ss.%uuid of player%.buying.playerto}%} to {ss.%uuid of player%.buying.playerto}
  308. set {ss.playersales-n::%{ss.%uuid of player%.buying.playerto}%} to 1
  309. else:
  310. add 1 to {ss.playersales-n::%{ss.%uuid of player%.buying.playerto}%}
  311. add {ss.%uuid of player%.buying.price} to {ss.totalmoney}
  312. remove {ss.%uuid of player%.buying.amount} of {ss.%uuid of player%.buying.item} from block at {ss.%uuid of player%.buying.chestloc}
  313. give {ss.%uuid of player%.buying.amount} of {ss.%uuid of player%.buying.item} to player
  314. subtract {ss.%uuid of player%.buying.price} from {pp::player::%uuid of player%::balance}
  315. add {ss.%uuid of player%.buying.price} to {pp::player::%{ss.%uuid of player%.buying.playerto}%::balance}
  316. message "{@P} You just bought %{_number-of-items}% %arg-3% from %{_playerto}% for %{_price}%"
  317. set {ss.%uuid of player%.buying} to false
  318. delete {ss.%uuid of player%.buying.chestloc}
  319. delete {ss.%uuid of player%.buying.item}
  320. delete {ss.%uuid of player%.buying.amount}
  321. delete {ss.%uuid of player%.buying.price}
  322. delete {ss.%uuid of player%.buying.playerto}
  323. else:
  324. message "{@P} You can't afford to do that"
  325. else:
  326. message "{@P} There was an error trying to see if the chest contains the items! Try again or contact the shop owner."
  327. else:
  328. message "{@P} There is nothing for you too buy!"
  329. else if {ss.%arg 1%.exists} is true:
  330. if arg 2 is not set:
  331. message "{@P} You must enter an item amount you want!"
  332. else if arg 3 is not set:
  333. message "{@P} You must enter the item you want!"
  334. else:
  335. set {_number-of-items} to arg 2 parsed as number
  336. if {ss.%arg 1%.chests::*} is empty:
  337. message "{@P} %arg 1% has no shops"
  338. stop
  339. set {_counter} to 0
  340. loop {ss.%arg 1%.chests::*}:
  341. add 1 to {_counter}
  342. if block at loop-value is chest:
  343. if block at loop-value contains {_number-of-items} of arg-3:
  344. set {_x} to x coordinate of loop-value
  345. set {_y} to y coordinate of loop-value
  346. set {_z} to z coordinate of loop-value
  347. add 1 to {_y}
  348. set {_cloc} to location at {_x}, {_y}, {_z}
  349. if block at {_cloc} is sign:
  350. if line 1 of block at {_cloc} is set:
  351. if line 2 of block at {_cloc} is set:
  352. if line 3 of block at {_cloc} is set:
  353. if line 4 of block at {_cloc} is set:
  354. set {_line3} to line 3 of block at {_cloc}
  355. set {_playerto} to line 1 of block at {_cloc} parsed as text
  356. if line 3 of block at {_cloc} contains "B" or "S" or ":" or " ":
  357. set {_txt} to line 4 of block at {_loc}
  358. replace all "B" and "S" and " " in {_txt} with ""
  359. set {_txt::*} to {_txt} split at ":"
  360. set {_line3} to {_txt::1}
  361. if line 1 of block at {_cloc} = "[Chest Shop]":
  362. if {McCS.Owner.%{_cloc}%} is set:
  363. set {_playerto} to {McCS.Owner.%{_cloc}%}
  364. set {_wamount} to {_number-of-items}
  365. set {_witem} to arg-3
  366. set {_amount} to line 2 of block at {_cloc} parsed as number
  367. set {_price} to {_line3} parsed as number
  368. set {_itemname} to line 4 of block at {_cloc} parsed as text
  369. if {_wamount} is equal to {_amount}:
  370. if "%{_witem}%" is equal to "%{_itemname}%":
  371. set {ss.%uuid of player%.buying.amount} to line 2 of block at {_cloc} parsed as number
  372. set {ss.%uuid of player%.buying} to true
  373. subtract 1 from {_y}
  374. set {ss.%uuid of player%.buying.chestloc} to location at {_x}, {_y}, {_z}
  375. set {ss.%uuid of player%.buying.item} to {_itemname} parsed as item
  376. set {ss.%uuid of player%.buying.price} to {_price}
  377. set {ss.%uuid of player%.buying.playerto} to {_playerto}
  378. message "{@P} You have now selected the following for purchase:"
  379. message "{@P} Item: %{ss.%uuid of player%.buying.item}%"
  380. message "{@P} Amount: %{ss.%uuid of player%.buying.amount}%"
  381. if {myc.enabled} is true:
  382. if {_price} is greater than 1:
  383. message "{@P} Price: %{ss.%uuid of player%.buying.price}%%{myc.currency.plural}%"
  384. else:
  385. message "{@P} Price: %{ss.%uuid of player%.buying.price}%%{myc.currency}%"
  386. else:
  387. message "{@P} Price: %{ss.%uuid of player%.buying.price}%"
  388. message "{@P} From Player: %{ss.%uuid of player%.buying.playerto}%"
  389. message "{@P} Do: /ss confirm - to buy this. You can review this purchase at any time by doing: /ss buy"
  390. exit
  391. else:
  392. message "{@P} Unknown command!"
  393. on rightclick on chest:
  394. if {ss.%uuid of player%.add} is true:
  395. set {_b} to block above event-block
  396. if {_b} is sign:
  397. line 1 of {_b} is "%player%" or "[Chest Shop]":
  398. set {_x} to x coordinate of block
  399. set {_y} to y coordinate of block
  400. set {_z} to z coordinate of block
  401. set {_ss.x} to floor({_x})
  402. set {_ss.y} to floor({_y})
  403. set {_ss.z} to floor({_z})
  404. set {_ss.cloc} to location at {_ss.x}, {_ss.y}, {_ss.z}
  405. add {_ss.cloc} to {ss.%player%.chests::*}
  406. message "{@P} Added: %{_ss.cloc}%"
  407. cancel event
  408. set {ss.%uuid of player%.add} to false
  409. if {ss.codegenapi.key} is set:
  410. if {@QuickShop} is true:
  411. execute console command "/codegenapi g c %{ss.codegenapi.key}% %player% 4"
  412. set {_c} to {cga.%{ss.codegenapi.key}%.%player%.code}
  413. set {ss.quickshop.%{_c}%} to location of event-block
  414. set {ss.quickshop.%location of event-block%} to {_c}
  415. set {ss.quickshop.details.%{_c}%} to location of event-block
  416. set {ss.quickshop.details.%{_c}%::playerto} to player
  417. set {ss.quickshop.details.%{_c}%::amount} to line 2 of {_b} parsed as text
  418. set {_pric::*} to line 3 of {_b} split at ":"
  419. set {_price} to {_pric::1}
  420. replace all "B" and " " in {_price} with ""
  421. set {ss.quickshop.details.%{_c}%::price} to {_price}
  422. set {ss.quickshop.details.%{_c}%::item} to line 4 of {_b} parsed as text
  423. message "{@P} Users can do /ss quickshop %{_c}% - to quickly buy from this shop"
  424. else:
  425. message "{@P} It needs to be your shop!"
  426. cancel event
  427. else if {ss.%uuid of player%.remove} is true:
  428. set {_b} to block above event-block
  429. loop blocks 1 above block:
  430. if loop-block is sign:
  431. line 1 of loop-block is "%player%" or "[Chest Shop]":
  432. set {_x} to x coordinate of block
  433. set {_y} to y coordinate of block
  434. set {_z} to z coordinate of block
  435. set {_ss.x} to floor({_x})
  436. set {_ss.y} to floor({_y})
  437. set {_ss.z} to floor({_z})
  438. set {_ss.cloc} to location at {_ss.x}, {_ss.y}, {_ss.z}
  439. remove {_ss.cloc} from {ss.%player%.chests::*}
  440. message "{@P} Removed: %{_ss.cloc}%"
  441. cancel event
  442. set {ss.%uuid of player%.remove} to false
  443. if {ss.quickshop.%location of event-block%} is set:
  444. set {_c} to {ss.quickshop.%location of event-block%}
  445. delete {ss.quickshop.details.%{_c}%::*}
  446. delete {ss.quickshop.%location of event-block%}
  447. delete {ss.quickshop.%{_c}%}
  448. else:
  449. message "{@P} It needs to be your shop!"
  450. cancel event
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement