10.06.2012, 07:23
Here's the code:
It doesn't update into the database, anyone know what's wrong in this code?
pawn Код:
new score = GetPlayerScore(playerid);
new money = GetPlayerMoney(playerid);
new query[1000], pname[24];
GetPlayerName(playerid, pname, 24);
format(query, sizeof(query), "UPDATE `PlayerData` SET Score='%d', Ip='%s', PlayerLevel='%d', StatsMetersDriven='%d', StatsTruckerJobs='%d', ", score,IP, APlayerData[playerid][PlayerLevel], APlayerData[playerid][StatsMetersDriven],APlayerData[playerid][StatsTruckerJobs]);
format(query, sizeof(query), "StatsConvoyJobs='%d', StatsBusDriverJobs='%d', StatsPilotJobs='%d', StatsMafiaJobs='%d', ",APlayerData[playerid][StatsConvoyJobs],APlayerData[playerid][StatsBusDriverJobs],APlayerData[playerid][StatsPilotJobs],APlayerData[playerid][StatsMafiaJobs]);
format(query, sizeof(query), "StatsMafiaStolen='%d', StatsPoliceFined='%d', StatsPoliceJailed='%d', StatsAssistance='%d', ",APlayerData[playerid][StatsMafiaStolen],APlayerData[playerid][StatsPoliceFined],APlayerData[playerid][StatsPoliceJailed],APlayerData[playerid][StatsAssistance]);
format(query, sizeof(query), "StatsCourierJobs='%d', StatsRoadworkerJobs='%d', Money='%d', OFWarns='%d', TruckerLicense='%d', BusLicense='%d' WHERE `Name`='%s'", APlayerData[playerid][StatsCourierJobs],APlayerData[playerid][StatsRoadworkerJobs],money,APlayerData[playerid][OFWarns],APlayerData[playerid][TruckerLicense],APlayerData[playerid][BusLicense],pname);
mysql_query(query);
}