29.12.2011, 18:20
I recently switched my hatching plugin to Whirlpool, I already got a problem.
This is the login dialog's code.
This is the register dialog's code: (a part of it)
I checked, the password is hashed in my user file.
Then I wanted to login, but it always said incorrect password..
Can you help me? :\
And the
This is the login dialog's code.
pawn Код:
new pHash[129];
WP_Hash(pHash,sizeof(pHash),inputtext);
if(!strcmp(pInfo[playerid][Pass],pHash)) {
INI_ParseFile(PlayerPath(playerid), "UserDataLoad_%s", .bExtra = true, .extra = playerid);
GivePlayerMoney(playerid,pInfo[playerid][Cash]);
SetPlayerScore(playerid,pInfo[playerid][Score]);
if(pInfo[playerid][AdminLevel] == 0) {
SendClientMessage(playerid,lime,"You've successfully logged in!");
} else {
SendClientMessage(playerid,lime,"Welcome,{FFFF00} administrator!");
}
pInfo[playerid][Logged] = 1;
} else {
if(gTries[playerid] == 0) gTries[playerid] = 1;
if(gTries[playerid] == 3) {
new iStr[128];
format(iStr,sizeof(iStr),"%s has been kicked for exceeding login tries.",pName(playerid));
SendClientMessageToAll(red,iStr);
return Kick(playerid);
}
new iStr[128];
format(iStr,sizeof(iStr),"You've entered an incorrect password. Tries: %i/3",gTries[playerid]);
ShowPlayerDialog(playerid,iDialog1,DIALOG_STYLE_INPUT,"Login",iStr,"Login","Leave");
gTries[playerid]++;
}
}
pawn Код:
new pHash[129],pIP[16];
if(!strlen(inputtext)) return ShowPlayerDialog(playerid,iDialog2,DIALOG_STYLE_INPUT,"Register","Please input a password.","Register","Leave");
WP_Hash(pHash,sizeof(pHash),inputtext);
pInfo[playerid][Pass] = pHash;
UserDataSave(playerid);
Then I wanted to login, but it always said incorrect password..
Can you help me? :\
And the