Account File Overwrite Problem
#1

Hello,

If any player connects to the server, the server doesn't recognize or can't find the accountfile.
I'ts only sometimes.
The User ist already registered on the Server, but the User get the Register-Dialog.
Anyone knows this problem? Can someone help me?

OnPlayerConnect(playerid)
{
new string[256];
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
format(string, sizeof(string), "users/%s.ini", name);
if(fexist(string))
{
ShowPlayerDialog(playerid,2,DIALOG_STYLE_INPUT,"Lo gin","Login with your Password.","Login","Exit");
}
else
{
ShowPlayerDialog(playerid,1,DIALOG_STYLE_INPUT,"Re gister","Choose a password.","Register","Exit");
}
return 1;
}
----------------------------------------------------------------------------------------------------------
//Register
if(dialogid == 1)
{
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "users/%s.ini", sendername);
if(fexist(string))
{
new loginstring[128];
format(loginstring,sizeof(loginstring),"You already have an Account.");
ShowPlayerDialog(playerid,3,DIALOG_STYLE_INPUT,"Lo gin",loginstring,"Login","Exit");
}
else
{
if(!response)
{
Kick(playerid);
}
if(response)
{
if(strlen(inputtext))
{
new tmppass[64];
strmid(tmppass, inputtext, 0, strlen(inputtext), 255);
OnPlayerRegister(playerid,tmppass);
}
else
{
new regstring[128];
format(regstring,sizeof(regstring),"You don't have an Account. Please register.");
ShowPlayerDialog(playerid,1,DIALOG_STYLE_INPUT,"Re gister",regstring,"Register","Exit");
}
}
}
}
//Login
if(dialogid == 2)
{
if(!response)
{
Kick(playerid);
}
if(response)
{
if(strlen(inputtext))
{
new tmppass[64];
strmid(tmppass, inputtext, 0, strlen(inputtext), 255);
OnPlayerLogin(playerid,tmppass);
}
else
{
new loginstring[128];
format(loginstring,sizeof(loginstring),"Wrong Password! Try again.");
ShowPlayerDialog(playerid,3,DIALOG_STYLE_INPUT,"Lo gin",loginstring,"Login","Exit");
}
}
}


Thanks
Shinoda
Reply


Messages In This Thread
Account File Overwrite Problem - by Shinoda90 - 15.04.2010, 19:34
Re: Account File Overwrite Problem - by RSC_Quicker - 15.04.2010, 20:49
Re: Account File Overwrite Problem - by Shinoda90 - 16.04.2010, 06:44

Forum Jump:


Users browsing this thread: 1 Guest(s)