Comparing two strings
#1

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?

Код:
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;
}
Thanks for help!
Reply


Messages In This Thread
Comparing two strings - by addys1 - 19.05.2017, 19:42
Re: Comparing two strings - by Aly - 19.05.2017, 19:49
Re: Comparing two strings - by CheezIt - 20.05.2017, 00:48

Forum Jump:


Users browsing this thread: 1 Guest(s)