Nobility Fix?

09/30/2010 08:06 BitzIn#1
I searched this and most of the people requesting it did not make sense ...
I wanna know how to fix an error i have in my nobility system:
The problem is when people donate the first time and become king they're donations dont stay & they dont stay king.
Instead their ign is taking the rank. So they have to re-donate.
If this is confusing ill provide screenshot.
09/30/2010 08:21 Fish*#2
Have u changed anything in nobility? o.O
I have never got problem
09/30/2010 08:29 BitzIn#3
i only reset it by deleting everything in the nobility.dat and then type /exit on console and then when a player donates that problem occurs =/
09/30/2010 11:38 Fish*#4
Because Nobility.dat is not the donation they got.
It just shows it.

To edit donatino of them, u need to edit it on the players.
Or make a command to set all nobilities = 0
09/30/2010 20:58 BitzIn#5
i used this:
i made the /expballs a nobility clear command:


PHP Code:
public static void ExpBallReset()
        {
            foreach (
string Path in Directory.GetFiles(@"C:\OldCODB\Users\Characters\"))
            {
                if (Path.Remove(0, Path.Length - 4) == "
.chr")
                {
                    try
                    {
                        string Name = Path.Substring(Path.LastIndexOf("
\\") + 1, Path.LastIndexOf('.') - Path.LastIndexOf("\\") - 1);
                        Game.Character C;
                        C = Game.World.CharacterFromName2(Name);
                        if (C == null)
                        {
                            string Account = "";
                            C = LoadCharacter(Name, ref Account);
                            if (C != null)
                            {
                                C.ExpBallsUsedToday = 0;
                                C.LotteryUsed = 0;
                                C.UniversityPoints = 0;
                                C.Nobility.Donation = 0;
                                SaveCharacter(C, Account);
                            }
                        }
                        else
                        {
                            C.UniversityPoints = 0;
                            C.ExpBallsUsedToday = 0;
                            C.LotteryUsed = 0;
                            C.Nobility.Donation = 0;
                        }
                    }
                    catch (Exception e)
                    {
                        Console.WriteLine(e.ToString());
                    }
                }
            }
        } 
id
After doing i opened my nobilty.dat delete all of it then do that command!(/expballs) in console! And then reset my server . it gets rid of all nobility, how ever this isnt the problem im havin my problem i wanna SAVE nobility.
09/30/2010 21:30 Fish*#6
if ur using the original source, then is already saving it.