14.01.2018, 16:19
Hello guys my updating table is not working
Here is my code:
Here is the OnPlayerDisconnect callback:
Here is my SavePlayersData callback:
Here is my code:
Here is the OnPlayerDisconnect callback:
PHP код:
mysql_format(zMySQL, string, sizeof(string), "SELECT * FROM `accounts` WHERE Username = '%e'", PlayerName(playerid));
mysql_tquery(zMySQL, string, "SavePlayersData", "d", playerid);
PHP код:
forward SavePlayersData(playerid);
public SavePlayersData(playerid)
{
new query2[2048];
mysql_format(zMySQL, query2, sizeof(query2), "UPDATE `accounts` SET `Money` = '%d', `Faction` = '%d', `Rank` = '%d', `Admin` = '%d', `VIP` = '%d', `Marijuana` = '%d', `Cocaine` = '%d', `Heroine` = '%d', `Amphetamine` = '%d', `Extasae` = '%d', `Spawn` = '%d', `aDuty` = '%d', `aList` = '%d', `Language` = '%d' WHERE `Username` = '%e'",
PlayerInfo[playerid][Money], PlayerInfo[playerid][Faction], PlayerInfo[playerid][Rank], PlayerInfo[playerid][Admin], PlayerInfo[playerid][VIP], PlayerInfo[playerid][Marijuana], PlayerInfo[playerid][Cocaine], PlayerInfo[playerid][Heroine], PlayerInfo[playerid][Amphetamine], PlayerInfo[playerid][Extasae], PlayerInfo[playerid][Spawn], PlayerInfo[playerid][aDuty], PlayerInfo[playerid][aList], PlayerInfo[playerid][Language], PlayerName(playerid));
mysql_query(zMySQL, query2);
return 1;
}