[Request] The save for the Inventory after converting into ini.
Discussion on [Request] The save for the Inventory after converting into ini. within the CO2 Private Server forum part of the Conquer Online 2 category.
public string Inv1 = "";
public string Inv2 = "";
public string Inv3 = "";
public string Inv4 = "";
public string Inv5 = "";
public string Inv6 = "";
public string Inv7 = "";
public string Inv8 = "";
@kinshi where excatly should i put those ?in database or character.cs?? cause i know tao's code goes into database.cs but i cant define ReadString can you help me with that ?? thank you
I've said before, I don't do my inventory like that, it saves just fine on one line.
Then again, I'm not using writestring(or whatever you guys are using).
public string Inv1 = "";
public string Inv2 = "";
public string Inv3 = "";
public string Inv4 = "";
public string Inv5 = "";
public string Inv6 = "";
public string Inv7 = "";
public string Inv8 = "";
then search for
Code:
public void PackInventory()
and replace that void with
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;
}
then search for
Code:
public void UnPackInventory()
and replace that void with
Code:
public void UnPackInventory()
{
Ready = false;
if (PackedInventory.Length < 1)
return;
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;
}
public string Inv1 = "";
public string Inv2 = "";
public string Inv3 = "";
public string Inv4 = "";
public string Inv5 = "";
public string Inv6 = "";
public string Inv7 = "";
public string Inv8 = "";
then search for
Code:
public void PackInventory()
and replace that void with
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;
}
then search for
Code:
public void UnPackInventory()
and replace that void with
Code:
public void UnPackInventory()
{
Ready = false;
if (PackedInventory.Length < 1)
return;
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;
}
[Request] Pills in inventory 04/13/2010 - 12Sky2 - 2 Replies I was wondering if there was some kind of hack to where if the player runs out of pills in the hotkeys, the program will use the pills inside of the inventory OR drag them to the hot keys some how.
[Request]Save Houses 01/25/2010 - CO2 Private Server - 3 Replies I followed the guide from pringle http://www.*************/forum/conqu...65-houses.h tml seemed 4botters wil be **** i give the link also as a code:
Code:
http://www.*************/forum/conquer-private-se rvers/7896-5165-houses.html
replace *** with 4botters. com
to make houses working, but now is my question how to get them saving when shutting down the server.
i followed a guide here to save halos, i tried to make houses save the same way but i could't get it working.
if anyone is...
[Request] Save conquer 2.0!! 05/25/2009 - Conquer Online 2 - 4 Replies many people have had their clients freeze randomly since 5127, the problem is the chat system and enlightenment icons freeze them, whenever they get whispered or w.e they freeze, someone PLS make an edit to change the chat system back to normal!! SAVE CONQUER PLAYERS EVERYWHERE!!! :mad: