17.03.2017, 11:37
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.
Help here is appreciated.
Код:
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)); }