31.07.2012, 12:56
I've tried to make a login and registration system using ******'s whirlpool.
The registration part works fine, but I am having problems with the login.
If anyone can see what I am doing wrong and can give me a solution, I would be very grateful:
The registration part works fine, but I am having problems with the login.
If anyone can see what I am doing wrong and can give me a solution, I would be very grateful:
pawn Код:
case DLG_LOGIN:
{
if(response == 1)
{
new encpass[129],stored[129];
GetPlayerName(playerid,pName,sizeof(pName));
format(pFile,sizeof(pFile),"Users/%s.txt",pName);
DOF2_GetStringEx(pFile,"password",stored,sizeof(stored));
WP_Hash(encpass,sizeof(encpass),inputtext);
if(strcmp(stored, inputtext,true) && strcmp(stored, encpass, true))
{
ShowPlayerDialog(playerid,DLG_LOGIN,DIALOG_STYLE_PASSWORD,"Galaxy RPG - Login","You entered your password incorrectly.\nPlease enter your password to login:","Login","Cancel");
return 1;
}
else
{
LoadPlayerStats(playerid);
return 1;
}
}
if(response == 0)
{
ShowPlayerDialog(playerid,DLG_LOGREGQUIT,0,"Quit","You have cancelled your login.","Ok","");
Kick(playerid);
return 1;
}
}