10.06.2012, 08:12
You re-format the query string every single time you use it. You didn't read what I posted in your other thread properly before.
For the first format, simply write in to the string. For the other formats, you need to re-add the previous format() by collecting the current value of 'query' and using it again, adding on to it.
pawn Код:
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), "%s StatsConvoyJobs='%d', StatsBusDriverJobs='%d', StatsPilotJobs='%d', StatsMafiaJobs='%d', ", query, APlayerData[playerid][StatsConvoyJobs],APlayerData[playerid][StatsBusDriverJobs],APlayerData[playerid][StatsPilotJobs],APlayerData[playerid][StatsMafiaJobs]);
format(query, sizeof(query), "%s StatsMafiaStolen='%d', StatsPoliceFined='%d', StatsPoliceJailed='%d', StatsAssistance='%d', ", query, APlayerData[playerid][StatsMafiaStolen],APlayerData[playerid][StatsPoliceFined],APlayerData[playerid][StatsPoliceJailed],APlayerData[playerid][StatsAssistance]);
format(query, sizeof(query), "%s StatsCourierJobs='%d', StatsRoadworkerJobs='%d', Money='%d', OFWarns='%d', TruckerLicense='%d', BusLicense='%d' WHERE `Name`='%s'", query, APlayerData[playerid][StatsCourierJobs],APlayerData[playerid][StatsRoadworkerJobs],money,APlayerData[playerid][OFWarns],APlayerData[playerid][TruckerLicense],APlayerData[playerid][BusLicense],pname);