Registration problem
#4

Apologies for the double post. Upon joining the server, the player's name does save in the database, but without a password. Passwords are (at least should be) saved using the code below.
Код:
stock RegisterPlayer(playerid, regpass[])
{
	new query[256], EncryptedPass[130];

	WP_Hash(EncryptedPass, sizeof(EncryptedPass), regpass);

	format(query, sizeof(query), "INSERT INTO users (Name, Password) VALUES ('%s', '%s')", GetName(playerid), EncryptedPass);
	mysql_query(query);

	LoginPlayer(playerid);

	return 1;
}
Код:
stock SavePlayer(playerid)
{
	new query[356], EncryptedPass[130];

	WP_Hash(EncryptedPass, sizeof(EncryptedPass), Player[playerid][Password]);

	format(query, sizeof(query), "UPDATE users SET Name = '%s', Password = '%s'", GetName(playerid), Player[playerid][Password]);
	mysql_query(query);
	printf("Player ID %d (%s) has been saved", playerid, GetName(playerid));
}
Help here is appreciated.
Reply


Messages In This Thread
Registration problem - by CrystalMethod - 17.03.2017, 04:19
Re: Registration problem - by X337 - 17.03.2017, 04:42
Re: Registration problem - by CrystalMethod - 17.03.2017, 05:05
Re: Registration problem - by CrystalMethod - 17.03.2017, 11:37

Forum Jump:


Users browsing this thread: 3 Guest(s)