04.08.2013, 11:01
(
Последний раз редактировалось Blademaster680; 04.08.2013 в 11:05.
Причина: adding description
)
I added the mysql_debug(1); and it stopped logging anything...
Its still not saving the playerdata...
I have got the database set up and the table's and structure right... But its not saving
In the database.. Should the Password and Name be a varchar or a Int?
Its still not saving the playerdata...
Код:
enum PlayerStats { Name[126], Password[126], Float: Position[3], }
Код:
public OnPlayerDisconnect(playerid, reason) { SavePlayer(playerid); return 1; }
Код:
stock SavePlayer(playerid) { new query[126], pName[MAX_PLAYER_NAME]; GetPlayerName(playerid, pName, sizeof(pName)); GetPlayerPos(playerid, Player[playerid][Position][0], Player[playerid][Position][1], Player[playerid][Position][2]); format(query, sizeof(query), "UPDATE accounts SET Name = '%s', Password = '%s', PlayerX = '%f', PlayerY = '%f', PlayerZ = '%f' WHERE name = '%s'", pName, Player[playerid][Password], Player[playerid][Position][0], Player[playerid][Position][1], Player[playerid][Position][2], pName); mysql_query(query); printf("Player ID %d (%s)has been saved", playerid, pName); }
In the database.. Should the Password and Name be a varchar or a Int?