Alright, well since I made a mistake in my first post, I'll make it up to you.
Pack:
UnPack:
The Ini file would be setup like this:
Save:
Don't forget to define:
Pack:
Code:
public void PackInventory()
{
if (!MyClient.There)
return;
Ready = false;
Inv1 = "";
Inv2 = "";
Inv3 = "";
Inv4 = "";
Inv5 = "";
Inv6 = "";
Inv7 = "";
Inv8 = "";
try
{
int count = 0;
foreach (string item in Inventory)
{
if (item != null && item != "")
{
if (count >= 0 && count <= 4)
{
if (count < 4)
Inv1 += item + ":";
else if (count == 4)
Inv1 += item;
}
if (count >= 5 && count <= 9)
{
if (count < 9)
Inv2 += item + ":";
else if (count == 9)
Inv2 += item;
}
else if (count >= 10 && count <= 14)
{
if (count < 14)
Inv3 += item + ":";
else if (count == 14)
Inv3 += item;
}
if (count >= 15 && count <= 19)
{
if (count < 19)
Inv4 += item + ":";
else if (count == 19)
Inv4 += item;
}
if (count >= 20 && count <= 24)
{
if (count < 24)
Inv5 += item + ":";
else if (count == 24)
Inv5 += item;
}
if (count >= 25 && count <= 29)
{
if (count < 29)
Inv6 += item + ":";
else if (count == 29)
Inv6 += item;
}
if (count >= 30 && count <= 34)
{
if (count < 34)
Inv7 += item + ":";
else if (count == 34)
Inv7 += item;
}
if (count >= 35 && count <= 39)
{
if (count < 39)
Inv8 += item + ":";
else if (count == 39)
Inv8 += item;
}
count++;
}
else
break;
}
}
catch (Exception E)
{
General.WriteLine(E.ToString());
}
Ready = true;
}
Code:
public void UnPackInventory()
{
Ready = false;
PackedInventory = Inv1 + ":" + Inv2 + ":" + Inv3 + ":" + Inv4 + ":" + Inv5 + ":" + Inv6 + ":" + Inv7 + ":" + Inv8;
string[] Items = PackedInventory.Split(':');
int count = 0;
foreach (string item in Items)
{
if (item != null)
if (item.Length > 1)
{
AddItem(item, 0, (uint)General.Rand.Next(10000000));
count++;
}
else
break;
}
Ready = true;
}
Code:
[Inventory] Inv1= Inv2= Inv3= Inv4= Inv5= Inv6= Inv7= Inv8=
Code:
Save.IniWriteValue("Inventory", "Inv1", Charr.Inv1);
Save.IniWriteValue("Inventory", "Inv2", Charr.Inv2);
Save.IniWriteValue("Inventory", "Inv3", Charr.Inv3);
Save.IniWriteValue("Inventory", "Inv4", Charr.Inv4);
Save.IniWriteValue("Inventory", "Inv5", Charr.Inv5);
Save.IniWriteValue("Inventory", "Inv6", Charr.Inv6);
Save.IniWriteValue("Inventory", "Inv7", Charr.Inv7);
Save.IniWriteValue("Inventory", "Inv8", Charr.Inv8);
Code:
public string Inv1 = "";
public string Inv2 = "";
public string Inv3 = "";
public string Inv4 = "";
public string Inv5 = "";
public string Inv6 = "";
public string Inv7 = "";
public string Inv8 = "";