17.03.2017, 05:05
So I've changed the zero to a one and that's working better.
I've got a problem now where when it says that the account is registered, nothing pops up in the database. If I leave then come back, it prompts me to register again.
Here's how accounts are logged in and saved.
I've got a problem now where when it says that the account is registered, nothing pops up in the database. If I leave then come back, it prompts me to register again.
Here's how accounts are logged in and saved.
Код:
stock LoginPlayer(playerid) { new query[126], pName[MAX_PLAYER_NAME]; GetPlayerName(playerid, pName, sizeof(pName)); format(query, sizeof(query), "SELECT * FROM users WHERE Name = '%s'", pName); mysql_query(query); mysql_store_result(); while(mysql_fetch_row_format(query, "|")) { mysql_fetch_field_row(Player[playerid][Name], "Name"); mysql_fetch_field_row(Player[playerid][Password], "Password"); } SpawnPlayer(playerid); } stock SavePlayer(playerid) { new query[126], pName[MAX_PLAYER_NAME]; GetPlayerName(playerid, pName, sizeof(pName)); format(query, sizeof(query), "UPDATE users SET Name = '%s', Password = '%s' WHERE Name = '%s'", pName, Player[playerid][Password], pName); mysql_query(query); printf("Player ID %d (%s) has been saved", playerid, pName); }