SA-MP Forums Archive
MySQL CreateAccount - 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)
+--- Thread: MySQL CreateAccount (/showthread.php?tid=655923)



MySQL CreateAccount - KamilPolska - 02.07.2018

How to replace it with MD5_Hash on WP_Hash?
Код:
MySQL_CreateAccount(playerid, pass[])
{
        if(!MYSQL_ON) return 0;
	
        new query[256];
        new password[64];
        format(password, 64, "%s", MD5_Hash(pass));
        format(g_SQL, query, sizeof(query), "INSERT INTO `accounts` (`Nickname`, `Key`) VALUES ('%s', '%s')", GetNick(playerid), password);
	mysql_query(g_SQL, query);
	return 1;
}
Код:
new buff[129];
WP_Hash(buff, 129, inputtext);
if(strcmp(PlayerInfo[playerid][pKey], buff, true) == 0)
WP_Hash(PlayerInfo[playerid][pKey], 129, inputtext);