02.06.2016, 13:23
For some reason the score of a player is not updating in MySQL:
PHP код:
public OnPlayerDisconnect(playerid, reason)
{
new
query[128],
Float:pos[4],
name[24],
score;
GetPlayerPos(playerid, pos[0], pos[1], pos[2]);
GetPlayerFacingAngle(playerid, pos[3]);
GetPlayerName(playerid, name, 24);
GetPlayerScore(playerid, Player[playerid][Score]);
mysql_format(mysql, query, sizeof(query), "UPDATE `accounts` SET `Money` = %d, `PosX` = %f, `PosY` = %f, `PosZ` = %f, `PosA` = %f WHERE `ID` = %d",
GetPlayerMoney(playerid), pos[0], pos[1], pos[2], pos[3], Player[playerid][ID]);
mysql_format(mysql, query, sizeof query, "UPDATE 'accounts' SET 'Score' = '%i' WHERE 'Name' = '%s'", score, name);
mysql_tquery(mysql, query, "", "");
return true;
}