SA-MP Forums Archive
Account File Overwrite Problem - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Account File Overwrite Problem (/showthread.php?tid=141875)



Account File Overwrite Problem - Shinoda90 - 15.04.2010

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


Re: Account File Overwrite Problem - RSC_Quicker - 15.04.2010

Are you sure the "users/%s.ini", is correct?
So scriptfiles> users > NAME.ini


Re: Account File Overwrite Problem - Shinoda90 - 16.04.2010

Yes it is. I said that it is only sometimes.