Input too long after substitutions?
#8

In the most causes its enough to put it into seperate lines
pawn Код:
// this does work
    if(strlen(APlayerData[playerid][PlayerPassword]) != 0) {
        new score = GetPlayerScore(playerid);
        new money = GetPlayerMoney(playerid);
        new query[1000], pname[24];
        GetPlayerName(playerid, pname, sizeof pname);
        format(query, sizeof(query), // the string is only 384 long, limit is over 500
            "UPDATE `PlayerData` SET Score='%d', Ip='%s', PlayerLevel='%d', StatsMetersDriven='%d', StatsTruckerJobs='%d', StatsConvoyJobs='%d', StatsBusDriverJobs='%d', StatsPilotJobs='%d', StatsMafiaJobs='%d', StatsMafiaStolen='%d', StatsPoliceFined='%d', StatsPoliceJailed='%d', StatsAssistance='%d', StatsCourierJobs='%d', StatsRoadworkerJobs='%d', Money='%d', OFWarns='%d' WHERE `Name`='%s'",
            score, IP, APlayerData[playerid][PlayerLevel], APlayerData[playerid][StatsMetersDriven],APlayerData[playerid][StatsTruckerJobs],APlayerData[playerid][StatsConvoyJobs],APlayerData[playerid][StatsBusDriverJobs],APlayerData[playerid][StatsPilotJobs],
            APlayerData[playerid][StatsMafiaJobs],APlayerData[playerid][StatsMafiaStolen],APlayerData[playerid][StatsPoliceFined],APlayerData[playerid][StatsPoliceJailed],APlayerData[playerid][StatsAssistance],APlayerData[playerid][StatsCourierJobs],APlayerData[playerid][StatsRoadworkerJobs],money,APlayerData[playerid][OFWarns],pname
        );
        mysql_query(query);
    }
if the string is over 500 you should declare it globally (the compiler does that anyways)
pawn Код:
new
    myQuery[] = "UPDATE `PlayerData` SET Score='%d', Ip='%s', PlayerLevel='%d', StatsMetersDriven='%d', StatsTruckerJobs='%d', StatsConvoyJobs='%d', StatsBusDriverJobs='%d',",
    myQuery1[] = "StatsPilotJobs='%d', StatsMafiaJobs='%d', StatsMafiaStolen='%d', StatsPoliceFined='%d', StatsPoliceJailed='%d', StatsAssistance='%d',",
    myQuery2[] = "StatsCourierJobs='%d', StatsRoadworkerJobs='%d', Money='%d', OFWarns='%d' WHERE `Name`='%s'"
;
//OnGameModeInit
// lets replace the EOS with a space
myQuery[sizeof myQuery - 1] = myQuery1[sizeof myQuery1 - 1] = ' ';
// we need to use myQuery2 at least once otherwise the compiler will remove it
myQuery2[sizeof myQuery2 - 1] = EOS;
// now if you want to test it
print(myQuery);
// it will print the whole query
Reply


Messages In This Thread
Input too long after substitutions? - by SomebodyAndMe - 09.06.2012, 08:55
Re: Input too long after substitutions? - by JaKe Elite - 09.06.2012, 08:58
Re: Input too long after substitutions? - by SomebodyAndMe - 09.06.2012, 09:09
Re: Input too long after substitutions? - by SomebodyAndMe - 09.06.2012, 10:46
Re: Input too long after substitutions? - by Vince - 09.06.2012, 10:51
Re: Input too long after substitutions? - by Calgon - 09.06.2012, 10:53
Re: Input too long after substitutions? - by [KHK]Khalid - 09.06.2012, 11:12
AW: Input too long after substitutions? - by Nero_3D - 09.06.2012, 12:28

Forum Jump:


Users browsing this thread: 1 Guest(s)