19.05.2017, 19:42
Hi, I've seen a lot of topics on this topic, but none of them could help me in any way. I would like to compare the encrypted password from the database with the encrypted text entered in the dialog. Someone knows something?
Thanks for help!
Код:
case DIALOG_LOGIN:
{
new Hash2[80];
new rows2, fields2;
mysql_query(mySQLconnection, sprintf("SELECT haslo FROM ipb_characters WHERE char_name = '%s' LIMIT 1", pInfo[playerid][player_name]));
cache_get_data(rows2, fields2);
format(Hash2, sizeof(Hash2), "%s%s", MD5_Hash(gInfo[playerid][global_salt]), MD5_Hash(inputtext));
format(Hash2, sizeof(Hash2), "%s", MD5_Hash(Hash2));
if(!strcmp(Hash2,rows2, true))
{
SendClientMessage(playerid, -1, "Nice Passwd, good boy");
gInfo[playerid][global_logged] = true;
OnPlayerLoginHere(playerid);
}
else
{
SendClientMessage(playerid, -1, "Wrong Passwd");
}
return 1;
}

