fix 100% code save characters lvl and all for 5165

03/08/2010 18:44 memo1340#1
hello all this code for save lvl character and cps

open Database.cs

and search

PHP Code:
                return "Error: Character already exists!"
del this code and add this new code


PHP Code:
if (File.Exists("C:\\OldCODB\\Users\\Characters\\" Name ".chr"))
                    return 
"Character already exists.";
                
IniFile F = new IniFile("C:\\OldCODB\\Users\\Characters\\" Name ".chr");
                
F.WriteString("Character""name"Name);
                
F.WriteString("Character""spouse""None");
                
F.WriteString("Character""whpass""");
                
F.WriteString("Character""account"Account);
                
F.WriteInteger("Character""body"Body);
                
F.WriteInteger("Character""hair", (410 + (Program.Rnd.Next(5) * 100)));
                
F.WriteInteger("Character""map"1010);
                
F.WriteInteger("Character""x"61);
                
F.WriteInteger("Character""y"110);
                
F.WriteInteger("Character""job"Job);
                
F.WriteInteger("Character""level"1);
                
F.WriteInteger("Character""strength"5);
                
F.WriteInteger("Character""agility"5);
                
F.WriteInteger("Character""vitality"5);
                
F.WriteInteger("Character""hitpoints"33);
                
F.WriteInteger("Character""silvers"10000);
                
F.WriteInteger("Character""merchant"1);
                
                
F.Save();
                
IniFile Dr = new IniFile("C:\\OldCODB\\Users\\" Account ".usr");
                
Dr.WriteString("User""character"Name);
                
Dr.Save();
                return 
"ANSWER_OK"

Good luck for all :handsdown::handsdown:
03/08/2010 19:28 walmartboi#2
Umm, I seriously have no clue what this is supposed to do/what the point of it is. -.-

Btw:

Code:
IniFile Dr = new IniFile("C:\\OldCODB\\Users\\" + Account + ".usr");
No checks?

And I still don't know what the point of this is LOL.
03/08/2010 20:12 Secrets-man#3
Quote:
Originally Posted by walmartboi View Post
Umm, I seriously have no clue what this is supposed to do/what the point of it is. -.-

Btw:

Code:
IniFile Dr = new IniFile("C:\\OldCODB\\Users\\" + Account + ".usr");
No checks?

And I still don't know what the point of this is LOL.
If I got it right, the point of it is to Save the characters.. I've noticed that sometimes Console gives you an exception about characters like someones acc didn't save. Happens Sometimes.
03/08/2010 21:18 memo1340#4
Quote:
Originally Posted by Bolopia View Post
Well good job but don't the characters already save?
man will save if you write /exit or /restart
03/08/2010 21:31 xScott#5
Quote:
Originally Posted by memo1340 View Post
man will save if you write /exit or /restart
isnt this already included in the source?
03/08/2010 21:35 walmartboi#6
Quote:
Originally Posted by memo1340 View Post
man will save if you write /exit or /restart
It does that by itself, and with this code you're creating a whole new file and not even saving everything.
03/09/2010 01:49 .Ocularis#7
This doesn't even look like like it suppose to save live character information, It looks like a code to save newly created account with extra things...