Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- cmd create shop shopUI
- cmd add shop onerror goto 240
- cmd add shop %player% = %p%
- cmd add shop if %args%[1] in onlineplayers() then let %player% = %args%[1]
- cmd add shop %ps% = playerstatus(%p%)
- cmd add shop if (%ps%[\"op\"] = %true%) and (%args%[1] in array(\"help\", \"category\", \"item\", \"reset\")) then goto 76
- cmd add shop load %shopcategories%
- cmd add shop if varset(%shopcategories%) = %false% then message %player% \"§b[§dShop§b] §aShop is currently under maintenance!\"
- cmd add shop if varset(%shopcategories%) = %false% then exit
- cmd add shop %size% = size(%shopcategories%)
- cmd add shop %num% = 0
- cmd add shop if %num% = %size% then goto 16
- cmd add shop %b%[\"text\"] = \"§0\" + %shopcategories%[%num%]
- cmd add shop %num% = %num% + 1
- cmd add shop %bs%[] = %b%
- cmd add shop goto 11
- cmd add shop %gui1%[\"type\"] = \"form\"
- cmd add shop %gui1%[\"title\"] = \"§b[§dShop§b]\"
- cmd add shop %gui1%[\"content\"] = \"Select a category\"
- cmd add shop %gui1%[\"buttons\"] = %bs%
- cmd add shop %res1% = dialog(%player%, %gui1%)
- cmd add shop if (%res1% = %false%) or (varset(%res1%) = %false%) then exit
- cmd add shop %bs2% =
- cmd add shop %category% = %shopcategories%[%res1%]
- cmd add shop %a%[\"text\"] = \"§7Go back\"
- cmd add shop %bs2%[] = %a%
- cmd add shop load %shopitems% %category%
- cmd add shop if varset(%shopitems%) = %false% then message %player% §b[§dShop§b] §aThat category is currently closed!
- cmd add shop if varset(%shopitems%) = %false% then exit
- cmd add shop %size% = size(%shopitems%)
- cmd add shop %num% = 0
- cmd add shop if %num% = %size% then goto 39
- cmd add shop %itemdata% = %shopitems%[%num%]
- cmd add shop %name% = %itemdata%[\"name\"]
- cmd add shop %price% = %itemdata%[\"price\"]
- cmd add shop %i2%[\"text\"] = \"§l§§\" + %name% +\"\\n§r§a$\" + %price%
- cmd add shop %bs2%[] = %i2%
- cmd add shop %num% = %num% + 1
- cmd add shop goto 31
- cmd add shop %gui2%[\"type\"] = \"form\"
- cmd add shop %gui2%[\"title\"] = \"§b[§dShop§b]\"
- cmd add shop %gui2%[\"content\"] = \"§eSelect item to buy\"
- cmd add shop %gui2%[\"buttons\"] = %bs2%
- cmd add shop %res2% = dialog(%player%, %gui2%)
- cmd add shop if %res2% = %false% then exit
- cmd add shop if %res2% = 0 then goto 20
- cmd add shop %res2% = int(int(%res2%) - 1)
- cmd add shop %item% = %shopitems%[%res2%]
- cmd add shop %itemname% = %item%[\"name\"]
- cmd add shop %itemprice% = %item%[\"price\"]
- cmd add shop %itemid% = %item%[\"id\"]
- cmd add shop %gui3%[\"type\"] = \"custom_form\"
- cmd add shop %gui3%[\"title\"] = \"§b[§dShop§b]\"
- cmd add shop %i0%[\"type\"] = \"label\"
- cmd add shop %i0%[\"text\"] = \"§e\" + %itemname%
- cmd add shop %i1%[\"type\"] = \"label\"
- cmd add shop %i1%[\"text\"] = \"§ePrice: §a$\" + %itemprice%
- cmd add shop %i2%[\"type\"] = \"slider\"
- cmd add shop %i2%[\"max\"] = 64
- cmd add shop %i2%[\"min\"] = 1
- cmd add shop %i2%[\"text\"] = \"§a$\" + %itemprice% + \" §7x \"
- cmd add shop %is%[] = %i0%
- cmd add shop %is%[] = %i1%
- cmd add shop %is%[] = %i2%
- cmd add shop %gui3%[\"content\"] = %is%
- cmd add shop %res3% = dialog(%player%, %gui3%)
- cmd add shop if %res3% = %false% then exit
- cmd add shop %qnty% = int(%res3%[2])
- cmd add shop %fprice% = int(%qnty%*int(%itemprice%))
- cmd add shop %playerbalance% = playerbalance(%player%)
- cmd add shop if %playerbalance% < %fprice% then message %player% §b[§dShop§b] §aYou don't have enough balance!
- cmd add shop if %playerbalance% < %fprice% then exit
- cmd add shop ascon /takemoney %player% %fprice%
- cmd add shop ascon /give %player% %itemid% %qnty%
- cmd add shop message %player% §b[§dShop§b] §aYou bought %qnty%x %itemname% for %fprice%!
- cmd add shop exit
- cmd add shop #op commands
- cmd add shop if %args%[1] = \"category\" then goto 82
- cmd add shop if %args%[1] = \"item\" then goto 132
- cmd add shop if %args%[1] = \"reset\" then goto 221
- cmd add shop if %args%[1] = \"help\" then message %p% \"§b[§dShop§b]\\n§a/shop category add <name> - §eAdd a new category\\n§a/shop category delete <name> - §eDelete a category\\n§a/shop category edit <name> - §eEdit a category\\n§a/shop item add <category> <name> <id> <price> - §eAdd an item into a category\\n§a/shop item edit <category> <name> - §eEdit an item in a category\\n§a/shop item delete <category> <name> - §eDelete an item in a category\\n§c/shop reset - §eReset the Shop\"
- cmd add shop exit
- cmd add shop #category
- cmd add shop if %args%[2] = \"add\" then goto 88
- cmd add shop if %args%[2] = \"delete\" then goto 100
- cmd add shop if %args%[2] = \"edit\" then goto 115
- cmd add shop message %p% \"§b[§dShop§b]\\n§a/shop category add [name]\\n/shop category delete [name] - this will delete items within the category aswell\\n/shop category edit [name]\"
- cmd add shop exit
- cmd add shop #add
- cmd add shop if varset(%args%[3]) = %false% then message %p% §eUsage: /shop category add [name]
- cmd add shop if varset(%args%[3]) = %false% then exit
- cmd add shop %category% = %args%[3]
- cmd add shop load %shopcategories%
- cmd add shop if varset(%shopcategories%) = %false% then goto 96
- cmd add shop if %category% in %shopcategories% then message %p% §b[§dShop§b] §aCategory name already exist!
- cmd add shop if %category% in %shopcategories% then exit
- cmd add shop %shopcategories%[] = %category%
- cmd add shop save %shopcategories%
- cmd add shop message %p% §b[§dShop§b] §aCategory added!
- cmd add shop exit
- cmd add shop #delete
- cmd add shop if varset(%args%[3]) = %false% then message %p% §eUsage: /shop category shop delete [name]
- cmd add shop if varset(%args%[3]) = %false% then exit
- cmd add shop %category% = %args%[3]
- cmd add shop load %shopcategories%
- cmd add shop if %category% notin %shopcategories% then message %p% §b[§dShop§b] §aCategory doesn't exist!
- cmd add shop if %category% notin %shopcategories% then exit
- cmd add shop %pos% = position(%shopcategories%, %category%)
- cmd add shop %shopcategories%[%pos%] =
- cmd add shop %shopcategories%[] =
- cmd add shop save %shopcategories%
- cmd add shop %shopitems% =
- cmd add shop save %shopitems% %category%
- cmd add shop message %p% §b[§dShop§b] §aCategory deleted!
- cmd add shop exit
- cmd add shop #edit
- cmd add shop if (varset(%args%[3]) = %false%) or (varset(%args%[4]) = %false%) then message %p% §eUsage: /shop category edit [name] [newname]
- cmd add shop if (varset(%args%[3]) = %false%) or (varset(%args%[4]) = %false%) then exit
- cmd add shop %oldcategory% = %args%[3]
- cmd add shop %newcategory% = %args%[4]
- cmd add shop load %shopcategories%
- cmd add shop if %oldcategory% notin %shopcategories% then message %p% §b[§dShop§b] §aCategory doesn't exist!
- cmd add shop if %oldcategory% notin %shopcategories% then exit
- cmd add shop %pos% = position(%shopcategories%, %oldcategory%)
- cmd add shop %shopcategories%[%pos%] = %newcategory%
- cmd add shop save %shopcategories%
- cmd add shop load %shopitems% %oldcategory%
- cmd add shop save %shopitems% %newcategory%
- cmd add shop %shopitems% =
- cmd add shop save %shopitems% %oldcategory%
- cmd add shop message %p% §b[§dShop§b] §aCategory edited!
- cmd add shop exit
- cmd add shop #item
- cmd add shop if %args%[2] = \"add\" then goto 138
- cmd add shop if %args%[2] = \"delete\" then goto 153
- cmd add shop if %args%[2] = \"edit\" then goto 174
- cmd add shop message %p% \"§b[§dShop§b]\\n§a/shop item add [category] [name] [price] [item id]\\n/shop item delete [category] [name]\\n/shop item edit [category] [name]\"
- cmd add shop exit
- cmd add shop #add
- cmd add shop if (varset(%args%[3]) = %false%) or (varset(%args%[4]) = %false%) or (varset(%args%[5]) = %false%) or (varset(%args%[6]) = %false%) then message %p% §eUsage: /shop item add [category] [name] [price] [item id]
- cmd add shop if (varset(%args%[3]) = %false%) or (varset(%args%[4]) = %false%) or (varset(%args%[5]) = %false%) or (varset(%args%[6]) = %false%) then exit
- cmd add shop %category% = %args%[3]
- cmd add shop load %shopcategories%
- cmd add shop if %category% notin %shopcategories% then message %p% §b[§dShop§b] §aCategory doesn't exist!
- cmd add shop if %category% notin %shopcategories% then exit
- cmd add shop %item%[\"name\"] = %args%[4]
- cmd add shop %item%[\"price\"] = %args%[5]
- cmd add shop %item%[\"id\"] = %args%[6]
- cmd add shop load %shopitems% %category%
- cmd add shop %shopitems%[] = %item%
- cmd add shop save %shopitems% %category%
- cmd add shop message %p% §b[§dShop§b] §aItem Saved!
- cmd add shop exit
- cmd add shop #delete
- cmd add shop if (varset(%args%[3]) = %false%) or (varset(%args%[4]) = %false%) then message %p% §b[§dShop§b] §eUsage: /shop item delete [category] [name]
- cmd add shop if (varset(%args%[3]) = %false%) or (varset(%args%[4]) = %false%) then exit
- cmd add shop %category% = %args%[3]
- cmd add shop %name% = %args%[4]
- cmd add shop load %shopcategories%
- cmd add shop if %category% notin %shopcategories% then message %p% §b[§dShop§b] §aCategory doesn't exist!
- cmd add shop if %category% notin %shopcategories% then exit
- cmd add shop load %shopitems% %category%
- cmd add shop %size% = size(%shopitems%)
- cmd add shop %size% = %size% - 1
- cmd add shop if %size% = -1 then message %p% §b[§dShop§b] §aItem doesn't exist!
- cmd add shop if %size% = -1 then exit
- cmd add shop %item% = %shopitems%[%size%]
- cmd add shop if %item%[\"name\"] = %name% then goto 169
- cmd add shop goto 163
- cmd add shop %shopitems%[%size%] =
- cmd add shop %shopitems%[] =
- cmd add shop save %shopitems% %category%
- cmd add shop message %p% §b[§dShop§b] §aItem deleted!
- cmd add shop exit
- cmd add shop #edit
- cmd add shop if (varset(%args%[3]) = %false%) or (varset(%args%[4]) = %false%) then message %p% §eUsage: /shop item edit [category] [name]
- cmd add shop if (varset(%args%[3]) = %false%) or (varset(%args%[4]) = %false%) then exit
- cmd add shop %category% = %args%[3]
- cmd add shop %name% = %args%[4]
- cmd add shop load %shopcategories%
- cmd add shop if %category% notin %shopcategories% then message %p% §b[§dShop§b] §aCategory doesn't exist!
- cmd add shop if %category% notin %shopcategories% then exit
- cmd add shop load %shopitems% %category%
- cmd add shop %size% = size(%shopitems%)
- cmd add shop %size% = %size% - 1
- cmd add shop if %size% = -1 then message %p% §b[§dShop§b] §aItem doesn't exist!
- cmd add shop if %size% = -1 then exit
- cmd add shop %item% = %shopitems%[%size%]
- cmd add shop if %item%[\"name\"] = %name% then goto 190
- cmd add shop goto 184
- cmd add shop %gui%[\"type\"] = \"custom_form\"
- cmd add shop %gui%[\"title\"] = \"§b[§dShop§b]\"
- cmd add shop %i0%[\"type\"] = \"label\"
- cmd add shop %i0%[\"text\"] = \"editing item \" + %item%[\"name\"]
- cmd add shop %i1%[\"type\"] = \"input\"
- cmd add shop %i1%[\"text\"] = \"item's name\"
- cmd add shop %i1%[\"placeholder\"] = \"text only\"
- cmd add shop %i1%[\"default\"] = %item%[\"name\"]
- cmd add shop %i2%[\"type\"] = \"input\"
- cmd add shop %i2%[\"text\"] = \"item's price\"
- cmd add shop %i2%[\"placeholder\"] = \"§7Ex. 10000\"
- cmd add shop %i2%[\"default\"] = \"\" + %item%[\"price\"] + \"\"
- cmd add shop %i3%[\"type\"] = \"input\"
- cmd add shop %i3%[\"text\"] = \"item's id\"
- cmd add shop %i3%[\"placeholder\"] = \"§7Ex. 17:10\"
- cmd add shop %i3%[\"default\"] = \"\" + %item%[\"id\"] + \"\"
- cmd add shop %is%[] = %i0%
- cmd add shop %is%[] = %i1%
- cmd add shop %is%[] = %i2%
- cmd add shop %is%[] = %i3%
- cmd add shop %gui%[\"content\"] = %is%
- cmd add shop %res% = dialog(%p%, %gui%)
- cmd add shop if %res% = %false% then exit
- cmd add shop load %shopitems%
- cmd add shop %newitem%[\"name\"] = %res%[1]
- cmd add shop %newitem%[\"price\"] = %res%[2]
- cmd add shop %newitem%[\"id\"] = %res%[3]
- cmd add shop %shopitems%[%size%] = %newitem%
- cmd add shop save %shopitems% %category%
- cmd add shop message %p% §b[§dShop§b] §aItem Edited!
- cmd add shop exit
- cmd add shop #reset
- cmd add shop %gui%[\"type\"] = \"modal\"
- cmd add shop %gui%[\"title\"] = \"§b[§dShop§b]\"
- cmd add shop %gui%[\"content\"] = \"§fAre you sure you want to reset the shop data?\\n§0All your categories and items added to shop will be lost.\"
- cmd add shop %gui%[\"button1\"] = \"§eYes\"
- cmd add shop %gui%[\"button2\"] = \"§7No\"
- cmd add shop %res% = dialog(%p%, %gui%)
- cmd add shop if %res% = %false% then exit
- cmd add shop load %shopcategories%
- cmd add shop %size% = size(%shopcategories%)
- cmd add shop %size% = %size% - 1
- cmd add shop if %size% = -1 then goto 237
- cmd add shop %category% = %shopcategories%[%size%]
- cmd add shop %shopitems% =
- cmd add shop save %shopitems% %category%
- cmd add shop goto 231
- cmd add shop %shopcategories% =
- cmd add shop save %shopcategories%
- cmd add shop message %p% §b[§dShop§b] §aShop data has been reset!
- cmd add shop exit
- cmd add shop #1.0.2
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement