21.03.2017, 19:23
Whenever I join my server under another name, it just overwrites the previous account in the database.
Код:
stock RegisterPlayer(playerid, regpass[]) { new query[256], EncryptedPass[130]; WP_Hash(EncryptedPass, sizeof(EncryptedPass), regpass); printf("player pass: %s",EncryptedPass); format(query, sizeof(query), "INSERT INTO users (Name, Password) VALUES ('%s', '%s')", GetName(playerid), EncryptedPass); mysql_query(query); printf("Player ID %d (%s) has been registered", playerid, GetName(playerid)); SendClientMessage(playerid, -1, "Account registered!"); LoginPlayer(playerid); return 1; }