Permalink
Browse files

No longer used obfuscated code

  • Loading branch information...
1 parent ed4e300 commit 617ad9bd6670f63edc7a31e654c0d2367304422c @Zamirathe Zamirathe committed Apr 20, 2015
@@ -0,0 +1,35 @@
+using System;
+using Rocket.RocketAPI;
+
+namespace UconomyBasicShop
+{
+ public class CommandSell : IRocketCommand
+ {
+ public bool RunFromConsole
+ {
+ get
+ {
+ return false;
+ }
+ }
+ public string Name
+ {
+ get
+ {
+ return "sell";
+ }
+ }
+ public string Help
+ {
+ get
+ {
+ return "Allows you to sell items to the shop from your inventory.";
+ }
+ }
+
+ public void Execute(RocketPlayer playerid, string msg)
+ {
+ UconomyBasicShop.Instance.Sell(playerid, msg);
+ }
+ }
+}
@@ -32,5 +32,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("1.1.0.0")]
-[assembly: AssemblyFileVersion("1.1.0.0")]
+[assembly: AssemblyVersion("1.1.0.1")]
+[assembly: AssemblyFileVersion("1.1.0.1")]
@@ -20,7 +20,7 @@ protected override void Load()
this.ShopDB = new DatabaseMgr();
}
- public delegate void PlayerShopBuy(RocketPlayer player, decimal amt, byte items, ushort item);
+ public delegate void PlayerShopBuy(RocketPlayer player, decimal amt, byte items, ushort item, string type="item");
public event PlayerShopBuy OnShopBuy;
public delegate void PlayerShopSell(RocketPlayer player, decimal amt, byte items, ushort item);
public event PlayerShopSell OnShopSell;
@@ -107,7 +107,7 @@ public void Buy(RocketPlayer playerid, string msg)
message = String.Format(UconomyBasicShop.Instance.Configuration.VehicleBuyMsg, name, cost, Uconomy.Instance.Configuration.MoneyName, newbal, Uconomy.Instance.Configuration.MoneyName);
message = "You bought " + name + " for " + cost.ToString() + " " + Uconomy.Instance.Configuration.MoneyName + ".";
if (UconomyBasicShop.Instance.OnShopBuy != null)
- UconomyBasicShop.Instance.OnShopBuy(playerid, cost, 1, id);
+ UconomyBasicShop.Instance.OnShopBuy(playerid, cost, 1, id, "vehicle");
RocketChatManager.Say(playerid, message);
break;
default:
@@ -354,11 +354,11 @@ public void Sell(RocketPlayer playerid, string msg)
// These are single items, not ammo or magazines
while (amttosell > 0)
{
- if (playerid.Player.Equipment.checkSelection(list[0].W, list[0].ItemJar.PositionX, list[0].ItemJar.PositionY))
+ if (playerid.Player.Equipment.checkSelection(list[0].InventoryGroup, list[0].ItemJar.PositionX, list[0].ItemJar.PositionY))
{
playerid.Player.Equipment.dequip();
}
- playerid.Inventory.removeItem(list[0].W, playerid.Inventory.getIndex(list[0].W, list[0].ItemJar.PositionX, list[0].ItemJar.PositionY));
+ playerid.Inventory.removeItem(list[0].InventoryGroup, playerid.Inventory.getIndex(list[0].InventoryGroup, list[0].ItemJar.PositionX, list[0].ItemJar.PositionY));
list.RemoveAt(0);
amttosell--;
}
@@ -367,26 +367,26 @@ public void Sell(RocketPlayer playerid, string msg)
// This is ammo or magazines
while (amttosell > 0)
{
- if (playerid.Player.Equipment.checkSelection(list[0].W, list[0].ItemJar.PositionX, list[0].ItemJar.PositionY))
+ if (playerid.Player.Equipment.checkSelection(list[0].InventoryGroup, list[0].ItemJar.PositionX, list[0].ItemJar.PositionY))
{
playerid.Player.Equipment.dequip();
}
if (list[0].ItemJar.Item.Amount >= amttosell)
{
byte left = (byte)(list[0].ItemJar.Item.Amount - amttosell);
- playerid.Inventory.sendUpdateAmount(list[0].W, list[0].ItemJar.PositionX, list[0].ItemJar.PositionY, left);
+ playerid.Inventory.sendUpdateAmount(list[0].InventoryGroup, list[0].ItemJar.PositionX, list[0].ItemJar.PositionY, left);
amttosell = 0;
if (left == 0)
{
- playerid.Inventory.removeItem(list[0].W, playerid.Inventory.getIndex(list[0].W, list[0].ItemJar.PositionX, list[0].ItemJar.PositionY));
+ playerid.Inventory.removeItem(list[0].InventoryGroup, playerid.Inventory.getIndex(list[0].InventoryGroup, list[0].ItemJar.PositionX, list[0].ItemJar.PositionY));
list.RemoveAt(0);
}
}
else
{
amttosell -= list[0].ItemJar.Item.Amount;
- playerid.Inventory.sendUpdateAmount(list[0].W, list[0].ItemJar.PositionX, list[0].ItemJar.PositionY, 0);
- playerid.Inventory.removeItem(list[0].W, playerid.Inventory.getIndex(list[0].W, list[0].ItemJar.PositionX, list[0].ItemJar.PositionY));
+ playerid.Inventory.sendUpdateAmount(list[0].InventoryGroup, list[0].ItemJar.PositionX, list[0].ItemJar.PositionY, 0);
+ playerid.Inventory.removeItem(list[0].InventoryGroup, playerid.Inventory.getIndex(list[0].InventoryGroup, list[0].ItemJar.PositionX, list[0].ItemJar.PositionY));
list.RemoveAt(0);
}
}

0 comments on commit 617ad9b

Please sign in to comment.