--->IM USING LOTF 5017<---
NOTE** THIS IS NOT A RELEASE**<---After following the
of MaryJuana about how to add top rank in your source i was thinking about to make it more advanced so others can see it and you don't have to use the command every time you relog. Now i've coded alot and after hours of work and i finally had a succesfull build, my char was invisible. Only the chars who had the top rank in my database. Now i'll show some of scripts and tell you in where i add them. Client.cs under Public void SaveRank()
Code:
public void Savetoprank()
{
LastSave = DateTime.Now;
if (MyClient.There)
if (MyClient.Online)
{
InternalDatabase.SaveChar(this);
InternalDatabase.Savetoprank(this);
}
}
Code:
public byte toprank = 0;
Code:
public void Savetoprank()
{
LastSave = DateTime.Now;
if (MyClient.There)
if (MyClient.Online)
{
InternalDatabase.SaveChar(this);
InternalDatabase.Savetoprank(this);
}
}
Code:
Charr.toprank = Convert.ToByte((uint)DR["toprank"]);
Code:
public static void Savetoprank(Character Charr)
{
MySqlCommand Command = null;
Command = new MySqlCommand("UPDATE `Characters` SET `toprank` = '" + Charr.toprank + "' WHERE `Account` = '" + Charr.MyClient.Account + "'", ExternalDatabase.Connection);
Command.ExecuteNonQuery();
}
Charr.MyClient.SendPacket(General.MyPackets.GuildN ame(Me.GuildID, Me.MyGuild.GuildName));
In Client.CS below if (MyChar.Rank == 1)... .. ...Quote:
if (Me.toprank == 1)
Charr.MyClient.SendPacket(General.MyPackets.String (Me.UID, 10, "gamefighter"));
if (Me.toprank == 2)
Charr.MyClient.SendPacket(General.MyPackets.String (Me.UID, 10, "gamewarrior"));
if (Me.toprank == 3)
Charr.MyClient.SendPacket(General.MyPackets.String (Me.UID, 10, "gamebow"));
if (Me.toprank == 4)
Charr.MyClient.SendPacket(General.MyPackets.String (Me.UID, 10, "gamewater"));
if (Me.toprank == 5)
Charr.MyClient.SendPacket(General.MyPackets.String (Me.UID, 10, "gamefire"));
Code:
if (MyChar.toprank == 1)
{
SendPacket(General.MyPackets.String(MyChar.UID, 10, "gamefighter"));
}
if (MyChar.toprank == 2)
{
SendPacket(General.MyPackets.String(MyChar.UID, 10, "gamewarrior"));
}
if (MyChar.toprank == 3)
{
SendPacket(General.MyPackets.String(MyChar.UID, 10, "gamebow"));
}
if (MyChar.toprank == 4)
{
SendPacket(General.MyPackets.String(MyChar.UID, 10, "gamewater"));
}
if (MyChar.toprank == 5)
Also my console give me an error when im logging in using a charr with the
Top Effect.
The console error is
Code:
System.InvalidCastException: Specified cast is not valid. at COServer_Project.InternalDatabase.GetCharInfo(Character Charr, String UserName) in O:\BasicCO\COServerProject\COServerProject\DataBase.cs:line 261
A: So i can make NPC giving it. And because its nice







