nfell2009

MyConomy ChestShop Fixes

Apr 18th, 2014
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 7.34 KB | None | 0 0
  1. on leftclick:
  2.     if targeted block is wall sign:
  3.         if {McCS.Shops.%location of event-block%} is true:
  4.             if player is not holding any axe:
  5.                 if {McCS.Owner.%location of event-block%} is not player:
  6.                     if block at location of block below event-block is a chest:
  7.                         player has {McCS.ItemCount.%location of event-block%} of {McCS.ItemType.%location of event-block%}:
  8.                             if the block at location of block below event-block can hold {McCS.ItemCount.%location of event-block%} of {McCS.ItemType.%location of event-block%}:
  9.                                 if {myc.%{McCS.Owner.%location of event-block%}%.money} is greater or equal to {McCS.PriceSell.%location of event-block%}:
  10.                                     if player has permission "McCS.Shop.Buy":
  11.                                         execute op command "/myc-transaction normal MyConomy_ChestShops %{McCS.Owner.%location of event-block%}% %player% %{McCS.PriceSell.%location of event-block%}%"
  12.                                         if {myc.%player%.tcomplete} is true:
  13.                                             set {myc.%player%.tcomplete} to false
  14.                                             add {McCS.ItemCount.%location of event-block%} of {McCS.ItemType.%location of event-block%} to the block at location of block below event-block
  15.                                             remove {McCS.ItemCount.%location of event-block%} of {McCS.ItemType.%location of event-block%} from player
  16.                                             log "[Chest Shop]: %player% was paid %{McCS.PriceBuy.%location of event-block%}% for selling %{McCS.ItemCount.%location of event-block%}% %{McCS.ItemType.%location of event-block%}% to %{McCS.Owner.%location of event-block%}%'s chest shop at %location of event-block%." to "myc/%{McCS.Owner.%location of event-block%}%"
  17.                                             log "[Chest Shop]: %player% was paid %{McCS.PriceBuy.%location of event-block%}% for selling %{McCS.ItemCount.%location of event-block%}% %{McCS.ItemType.%location of event-block%}% to %{McCS.Owner.%location of event-block%}%'s chest shop at %location of event-block%" to "myc/%player%"
  18.                                             if {McCS.PriceSell.%location of event-block%} is greater than 1:
  19.                                                 message "&6[&eMyC&6]&e: %{McCS.PriceSell.%location of event-block%}% %{myc.currency.plural}% were added to your account!"
  20.                                                 message "%{McCS.Prefix}%&f: %{McCS.ShopSellSucessful}% %{McCS.ItemCount.%location of event-block%}% %{McCS.ItemType.%location of event-block%}% to %{McCS.Owner.%location of event-block%}% for %{McCS.PriceSell.%location of event-block%}% %{myc.currency.plural}%!"
  21.                                             else:
  22.                                                 message "&6[&eMyC&6]&e: %{McCS.PriceSell.%location of event-block%}% %{myc.currency}% was added to your account!"
  23.                                                 message "%{McCS.Prefix}%&f: %{McCS.ShopSellSucessful}% %{McCS.ItemCount.%location of event-block%}% %{McCS.ItemType.%location of event-block%}% to %{McCS.Owner.%location of event-block%}% for %{McCS.PriceSell.%location of event-block%}% %{myc.currency}%!"
  24.                                             cancel the event
  25.                                         else:
  26.                                             message "%{McCS.Prefix}%&f: Transaction failed. Please try again."
  27.                                     else:
  28.                                         message "%{McCS.Prefix}%&f: %{McCS.ErrorPermissionShopBuy}%"
  29.                                         cancel the event
  30.                                         exit
  31.                                 else:
  32.                                     message "%{McCS.Prefix}%&f: %{McCS.BuyerNotEnoughMoney}%"
  33.                                     cancel the event
  34.                                     exit
  35.                             else:
  36.                                 message "%{McCS.Prefix}%&f: %{McCS.ErrorShopCantFit}% %{McCS.ItemCount.%location of event-block%}% %{McCS.ItemType.%location of event-block%}%!"
  37.                                 cancel the event
  38.                                 exit
  39.                            
  40.                         else:
  41.                             message "%{McCS.Prefix}%&f: %{McCS.ErrorFewItems}% %{McCS.ItemType.%location of event-block%}%!"
  42.                             cancel the event
  43.                             exit
  44.                     else:
  45.                         message "%{McCS.Prefix}%&f: %{McCS.ErrorShopChestGone}%"
  46.                         cancel the event
  47.                         exit
  48.                 else:
  49.                     message "%{McCS.Prefix}%&f: %{McCS.ErrorBuyOwnShop}%"
  50.                     cancel the event
  51.                     exit
  52.                
  53. on rightclick:
  54.     if targeted block is wall sign:
  55.         if {McCS.Shops.%location of event-block%} is true:
  56.             if player is not sneaking:
  57.                 if {McCS.Owner.%location of event-block%} is not player:
  58.                     if block at location of block below event-block is a chest:
  59.                         if the block at location of block below event-block contains {McCS.ItemCount.%location of event-block%} of {McCS.ItemType.%location of event-block%}:
  60.                             if the player can hold {McCS.ItemCount.%location of event-block%} of {McCS.ItemType.%location of event-block%}:
  61.                                 if {myc.%player%.money} is greater or equal to {McCS.PriceBuy.%location of event-block%}:
  62.                                     if player has permission "McCS.Shop.Sell":
  63.                                         execute op command "/myc-transaction normal MyConomy_ChestShops %player% %{McCS.Owner.%location of event-block%}% %{McCS.PriceBuy.%location of event-block%}%"
  64.                                         if {myc.%player%.tcomplete} is true:
  65.                                             set {myc.%player%.tcomplete} to false
  66.                                             remove {McCS.ItemCount.%location of event-block%} of {McCS.ItemType.%location of event-block%} from the block at location of block below event-block
  67.                                             give {McCS.ItemCount.%location of event-block%} of {McCS.ItemType.%location of event-block%} to the player
  68.                                             log "[Chest Shop]: %player% paid %{McCS.PriceBuy.%location of event-block%}% while buying %{McCS.ItemCount.%location of event-block%}% %{McCS.ItemType.%location of event-block%}% from %{McCS.Owner.%location of event-block%}%'s chest shop at %location of event-block%." to "myc/%{McCS.Owner.%location of event-block%}%"
  69.                                             log "[Chest Shop]: %player% paid %{McCS.PriceBuy.%location of event-block%}% while buying %{McCS.ItemCount.%location of event-block%}% %{McCS.ItemType.%location of event-block%}% from %{McCS.Owner.%location of event-block%}%'s chest shop at %location of event-block%." to "myc/%player%"
  70.                                             if {McCS.PriceBuy.%location of event-block%} is greater than 1:
  71.                                                 message "&6[&eMyC&6]&e: %{McCS.PriceBuy.%location of event-block%}% %{myc.currency.plural}% were removed from your account!"
  72.                                                 message "%{McCS.Prefix}%&f: %{McCS.ShopBuySucessful}% %{McCS.ItemCount.%location of event-block%}% %{McCS.ItemType.%location of event-block%}% from %{McCS.Owner.%location of event-block%}% for %{McCS.PriceBuy.%location of event-block%}% %{myc.currency.plural}%!"
  73.                                             else:
  74.                                                 message "&6[&eMyC&6]&e: %{McCS.PriceBuy.%location of event-block%}% %{myc.currency}% was removed from your account!"
  75.                                                 message "%{McCS.Prefix}%&f: %{McCS.ShopBuySucessful}% %{McCS.ItemCount.%location of event-block%}% %{McCS.ItemType.%location of event-block%}% from %{McCS.Owner.%location of event-block%}% for %{McCS.PriceBuy.%location of event-block%}% %{myc.currency}%!"
  76.                                             cancel the event
  77.                                         else:
  78.                                             message "%{McCS.Prefix}%&f: Transaction failed. Please try again."
  79.                                     else:
  80.                                         message "%{McCS.Prefix}%&f: %{McCS.ErrorPermissionShopSell}%"
  81.                                         cancel the event
  82.                                         exit
  83.                                 else:
  84.                                     message "%{McCS.Prefix}%&f: %{McCS.SellerNotEnoughMoney}%"
  85.                                     cancel the event
  86.                                     exit
  87.                             else:
  88.                                 message "%{McCS.Prefix}%&f: %{McCS.ErrorPlayerCantFit}% %{McCS.ItemCount.%location of event-block%}% %{McCS.ItemType.%location of event-block%}%!"
  89.                                 cancel the event
  90.                                 exit
  91.                         else:
  92.                             message "%{McCS.Prefix}%&f: %{McCS.ErrorShopFewItems}% %{McCS.ItemType.%location of event-block%}%!"
  93.                             cancel the event
  94.                             exit
  95.                     else:
  96.                         message "%{McCS.Prefix}%&f: %{McCS.ErrorShopChestGone}%"
  97.                         cancel the event
  98.                         exit
  99.                 else:
  100.                     message "%{McCS.Prefix}%&f: %{McCS.ErrorSellOwnShop}%"
  101.                     cancel the event
  102.                     exit
Advertisement
Add Comment
Please, Sign In to add comment