Permalink
Browse files

..

  • Loading branch information...
1 parent c6ae98c commit fbb717121d7abdf7e753459b326282c650cff5b6 Freenex1911 committed Nov 4, 2016
View
@@ -196,13 +196,13 @@ public void Execute(IRocketPlayer caller, string[] msg)
VehicleAsset va = (VehicleAsset)Assets.find(EAssetType.VEHICLE, id);
message = ZaupShop.Instance.Translate("changed_or_added_to_shop", new object[] {
ac,
- va.Name,
+ va.vehicleName,
msg[2]
});
- success = ZaupShop.Instance.ShopDB.AddVehicle((int)id, va.Name, decimal.Parse(msg[2]), change);
+ success = ZaupShop.Instance.ShopDB.AddVehicle((int)id, va.vehicleName, decimal.Parse(msg[2]), change);
if (!success)
{
- message = ZaupShop.Instance.Translate("error_adding_or_changing", new object[] { va.Name });
+ message = ZaupShop.Instance.Translate("error_adding_or_changing", new object[] { va.vehicleName });
}
this.sendMessage(caller, message, console);
break;
@@ -216,13 +216,13 @@ public void Execute(IRocketPlayer caller, string[] msg)
ItemAsset ia = (ItemAsset)Assets.find(EAssetType.ITEM, id);
message = ZaupShop.Instance.Translate("changed_or_added_to_shop", new object[] {
ac,
- ia.Name,
+ ia.itemName,
msg[2]
});
- success = ZaupShop.Instance.ShopDB.AddItem((int)id, ia.Name, decimal.Parse(msg[2]), change);
+ success = ZaupShop.Instance.ShopDB.AddItem((int)id, ia.itemName, decimal.Parse(msg[2]), change);
if (!success)
{
- message = ZaupShop.Instance.Translate("error_adding_or_changing", new object[] { ia.Name });
+ message = ZaupShop.Instance.Translate("error_adding_or_changing", new object[] { ia.itemName });
}
this.sendMessage(caller, message, console);
break;
@@ -245,11 +245,11 @@ public void Execute(IRocketPlayer caller, string[] msg)
return;
}
VehicleAsset va = (VehicleAsset)Assets.find(EAssetType.VEHICLE, id);
- message = ZaupShop.Instance.Translate("removed_from_shop", new object[] { va.Name });
+ message = ZaupShop.Instance.Translate("removed_from_shop", new object[] { va.vehicleName });
success = ZaupShop.Instance.ShopDB.DeleteVehicle((int)id);
if (!success)
{
- message = ZaupShop.Instance.Translate("not_in_shop_to_remove", new object[] { va.Name });
+ message = ZaupShop.Instance.Translate("not_in_shop_to_remove", new object[] { va.vehicleName });
}
this.sendMessage(caller, message, console);
break;
@@ -261,11 +261,11 @@ public void Execute(IRocketPlayer caller, string[] msg)
return;
}
ItemAsset ia = (ItemAsset)Assets.find(EAssetType.ITEM, id);
- message = ZaupShop.Instance.Translate("removed_from_shop", new object[] { ia.Name });
+ message = ZaupShop.Instance.Translate("removed_from_shop", new object[] { ia.itemName });
success = ZaupShop.Instance.ShopDB.DeleteItem((int)id);
if (!success)
{
- message = ZaupShop.Instance.Translate("not_in_shop_to_remove", new object[] { ia.Name });
+ message = ZaupShop.Instance.Translate("not_in_shop_to_remove", new object[] { ia.itemName });
}
this.sendMessage(caller, message, console);
break;
@@ -288,13 +288,13 @@ public void Execute(IRocketPlayer caller, string[] msg)
decimal buyb;
decimal.TryParse(msg[2], out buyb);
message = ZaupShop.Instance.Translate("set_buyback_price", new object[] {
- iab.Name,
+ iab.itemName,
buyb.ToString()
});
success = ZaupShop.Instance.ShopDB.SetBuyPrice((int)id, buyb);
if (!success)
{
- message = ZaupShop.Instance.Translate("not_in_shop_to_buyback", new object[] { iab.Name });
+ message = ZaupShop.Instance.Translate("not_in_shop_to_buyback", new object[] { iab.itemName });
}
this.sendMessage(caller, message, console);
break;
View
@@ -247,10 +247,10 @@ public void Buy(UnturnedPlayer playerid, string[] components0)
for (int i = 0; i < array2.Length; i++)
{
VehicleAsset vAsset = (VehicleAsset)array2[i];
- if (vAsset != null && vAsset.Name != null && vAsset.Name.ToLower().Contains(components[1].ToLower()))
+ if (vAsset != null && vAsset.vehicleName != null && vAsset.vehicleName.ToLower().Contains(components[1].ToLower()))
{
- id = vAsset.Id;
- name = vAsset.Name;
+ id = vAsset.id;
+ name = vAsset.vehicleName;
break;
}
}
@@ -263,7 +263,7 @@ public void Buy(UnturnedPlayer playerid, string[] components0)
}
else if (name == null && id != 0)
{
- name = ((VehicleAsset)Assets.find(EAssetType.VEHICLE, id)).Name;
+ name = ((VehicleAsset)Assets.find(EAssetType.VEHICLE, id)).vehicleName;
}
decimal cost = ZaupShop.Instance.ShopDB.GetVehicleCost(id);
decimal balance = Uconomy.Instance.Database.GetBalance(playerid.CSteamID.ToString());
@@ -307,10 +307,10 @@ public void Buy(UnturnedPlayer playerid, string[] components0)
for (int i = 0; i < array2.Length; i++)
{
ItemAsset vAsset = (ItemAsset)array2[i];
- if (vAsset != null && vAsset.Name != null && vAsset.Name.ToLower().Contains(components[0].ToLower()))
+ if (vAsset != null && vAsset.itemName != null && vAsset.itemName.ToLower().Contains(components[0].ToLower()))
{
- id = vAsset.Id;
- name = vAsset.Name;
+ id = vAsset.id;
+ name = vAsset.itemName;
break;
}
}
@@ -323,7 +323,7 @@ public void Buy(UnturnedPlayer playerid, string[] components0)
}
else if (name == null && id != 0)
{
- name = ((ItemAsset)Assets.find(EAssetType.ITEM, id)).Name;
+ name = ((ItemAsset)Assets.find(EAssetType.ITEM, id)).itemName;
}
cost = decimal.Round(ZaupShop.Instance.ShopDB.GetItemCost(id) * amttobuy, 2);
balance = Uconomy.Instance.Database.GetBalance(playerid.CSteamID.ToString());
@@ -378,10 +378,10 @@ public void Cost(UnturnedPlayer playerid, string[] components)
for (int i = 0; i < array2.Length; i++)
{
VehicleAsset vAsset = (VehicleAsset)array2[i];
- if (vAsset != null && vAsset.Name != null && vAsset.Name.ToLower().Contains(components[1].ToLower()))
+ if (vAsset != null && vAsset.vehicleName != null && vAsset.vehicleName.ToLower().Contains(components[1].ToLower()))
{
- id = vAsset.Id;
- name = vAsset.Name;
+ id = vAsset.id;
+ name = vAsset.vehicleName;
break;
}
}
@@ -394,7 +394,7 @@ public void Cost(UnturnedPlayer playerid, string[] components)
}
else if (name == null && id != 0)
{
- name = ((VehicleAsset)Assets.find(EAssetType.VEHICLE, id)).Name;
+ name = ((VehicleAsset)Assets.find(EAssetType.VEHICLE, id)).vehicleName;
}
decimal cost = ZaupShop.Instance.ShopDB.GetVehicleCost(id);
message = ZaupShop.Instance.Translate("vehicle_cost_msg", new object[] {name, cost.ToString(), Uconomy.Instance.Configuration.Instance.MoneyName});
@@ -413,10 +413,10 @@ public void Cost(UnturnedPlayer playerid, string[] components)
for (int i = 0; i < array2.Length; i++)
{
ItemAsset iAsset = (ItemAsset)array2[i];
- if (iAsset != null && iAsset.Name != null && iAsset.Name.ToLower().Contains(components[0].ToLower()))
+ if (iAsset != null && iAsset.itemName != null && iAsset.itemName.ToLower().Contains(components[0].ToLower()))
{
- id = iAsset.Id;
- name = iAsset.Name;
+ id = iAsset.id;
+ name = iAsset.itemName;
break;
}
}
@@ -429,7 +429,7 @@ public void Cost(UnturnedPlayer playerid, string[] components)
}
else if (name == null && id != 0)
{
- name = ((ItemAsset)Assets.find(EAssetType.ITEM, id)).Name;
+ name = ((ItemAsset)Assets.find(EAssetType.ITEM, id)).itemName;
}
cost = ZaupShop.Instance.ShopDB.GetItemCost(id);
decimal bbp = ZaupShop.Instance.ShopDB.GetItemBuyPrice(id);
@@ -479,10 +479,10 @@ public void Sell(UnturnedPlayer playerid, string[] components)
for (int i = 0; i < array2.Length; i++)
{
vAsset = (ItemAsset)array2[i];
- if (vAsset != null && vAsset.Name != null && vAsset.Name.ToLower().Contains(components[0].ToLower()))
+ if (vAsset != null && vAsset.itemName != null && vAsset.itemName.ToLower().Contains(components[0].ToLower()))
{
- id = vAsset.Id;
- name = vAsset.Name;
+ id = vAsset.id;
+ name = vAsset.itemName;
break;
}
}
@@ -496,7 +496,7 @@ public void Sell(UnturnedPlayer playerid, string[] components)
else if (name == null && id != 0)
{
vAsset = (ItemAsset)Assets.find(EAssetType.ITEM, id);
- name = vAsset.Name;
+ name = vAsset.itemName;
}
// Get how many they have
if (playerid.Inventory.has(id) == null)
@@ -506,18 +506,18 @@ public void Sell(UnturnedPlayer playerid, string[] components)
return;
}
List<InventorySearch> list = playerid.Inventory.search(id, true, true);
- if (list.Count == 0 || (vAsset.Amount == 1 && list.Count < amttosell))
+ if (list.Count == 0 || (vAsset.amount == 1 && list.Count < amttosell))
{
message = ZaupShop.Instance.Translate("not_enough_items_sell", new object[] {amttosell.ToString(), name});
UnturnedChat.Say(playerid, message);
return;
}
- if (vAsset.Amount > 1)
+ if (vAsset.amount > 1)
{
int ammomagamt = 0;
foreach (InventorySearch ins in list)
{
- ammomagamt += ins.ItemJar.Item.Amount;
+ ammomagamt += ins.jar.item.amount;
}
if (ammomagamt < amttosell)
{
@@ -538,21 +538,21 @@ public void Sell(UnturnedPlayer playerid, string[] components)
byte quality = 100;
decimal peritemprice = 0;
decimal addmoney = 0;
- switch (vAsset.Amount)
+ switch (vAsset.amount)
{
case 1:
// These are single items, not ammo or magazines
while (amttosell > 0)
{
- if (playerid.Player.Equipment.checkSelection(list[0].InventoryGroup, list[0].ItemJar.PositionX, list[0].ItemJar.PositionY))
+ if (playerid.Player.equipment.checkSelection(list[0].page, list[0].jar.x, list[0].jar.y))
{
- playerid.Player.Equipment.dequip();
+ playerid.Player.equipment.dequip();
}
if (ZaupShop.Instance.Configuration.Instance.QualityCounts)
- quality = list[0].ItemJar.Item.Durability;
+ quality = list[0].jar.item.durability;
peritemprice = decimal.Round(price * (quality / 100.0m), 2);
addmoney += peritemprice;
- playerid.Inventory.removeItem(list[0].InventoryGroup, playerid.Inventory.getIndex(list[0].InventoryGroup, list[0].ItemJar.PositionX, list[0].ItemJar.PositionY));
+ playerid.Inventory.removeItem(list[0].page, playerid.Inventory.getIndex(list[0].page, list[0].jar.x, list[0].jar.y));
list.RemoveAt(0);
amttosell--;
}
@@ -562,31 +562,31 @@ public void Sell(UnturnedPlayer playerid, string[] components)
byte amttosell1 = amttosell;
while (amttosell > 0)
{
- if (playerid.Player.Equipment.checkSelection(list[0].InventoryGroup, list[0].ItemJar.PositionX, list[0].ItemJar.PositionY))
+ if (playerid.Player.equipment.checkSelection(list[0].page, list[0].jar.x, list[0].jar.y))
{
- playerid.Player.Equipment.dequip();
+ playerid.Player.equipment.dequip();
}
- if (list[0].ItemJar.Item.Amount >= amttosell)
+ if (list[0].jar.item.amount >= amttosell)
{
- byte left = (byte)(list[0].ItemJar.Item.Amount - amttosell);
- list[0].ItemJar.Item.Amount = left;
- playerid.Inventory.sendUpdateAmount(list[0].InventoryGroup, list[0].ItemJar.PositionX, list[0].ItemJar.PositionY, left);
+ byte left = (byte)(list[0].jar.item.amount - amttosell);
+ list[0].jar.item.amount = left;
+ playerid.Inventory.sendUpdateAmount(list[0].page, list[0].jar.x, list[0].jar.y, left);
amttosell = 0;
if (left == 0)
{
- playerid.Inventory.removeItem(list[0].InventoryGroup, playerid.Inventory.getIndex(list[0].InventoryGroup, list[0].ItemJar.PositionX, list[0].ItemJar.PositionY));
+ playerid.Inventory.removeItem(list[0].page, playerid.Inventory.getIndex(list[0].page, list[0].jar.x, list[0].jar.y));
list.RemoveAt(0);
}
}
else
{
- amttosell -= list[0].ItemJar.Item.Amount;
- 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));
+ amttosell -= list[0].jar.item.amount;
+ playerid.Inventory.sendUpdateAmount(list[0].page, list[0].jar.x, list[0].jar.y, 0);
+ playerid.Inventory.removeItem(list[0].page, playerid.Inventory.getIndex(list[0].page, list[0].jar.x, list[0].jar.y));
list.RemoveAt(0);
}
}
- peritemprice = decimal.Round(price * ((decimal)amttosell1 / (decimal)vAsset.Amount), 2);
+ peritemprice = decimal.Round(price * ((decimal)amttosell1 / (decimal)vAsset.amount), 2);
addmoney += peritemprice;
break;
}
Binary file not shown.
Binary file not shown.
View
Binary file not shown.
View
Binary file not shown.
Binary file not shown.
View
Binary file not shown.

0 comments on commit fbb7171

Please sign in to comment.