SA-MP Forums Archive
Mysql loading all cars skips first one - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Mysql loading all cars skips first one (/showthread.php?tid=427157)



Mysql loading all cars skips first one - Dj_maryo1993 - 31.03.2013

The problem is that it skips the first line from mysql
pawn Код:
public LoadSQLCars()
{
    new query[25];
    new value[32];
    new wholeline[2048];
    new rowwy[64];
    new sqlid;
    format(query, sizeof(query), "SELECT * FROM `vehicles`");
    mysql_query(query);
    mysql_store_result();
    mysql_fetch_row(wholeline);
    ///-----
    for(new i = 0; i < mysql_num_rows()+1; i++)
    {
        sqlid=i;
        mysql_fetch_row(rowwy,"|");
        sscanf(rowwy, "p<|>iis[20]iiffffiiid",value,CarInfo[sqlid][Owned],CarInfo[sqlid][Owner],CarInfo[sqlid][Faction],CarInfo[sqlid][Model],CarInfo[sqlid][Cx],CarInfo[sqlid][Cy],CarInfo[sqlid][Cz],CarInfo[sqlid][Inc],CarInfo[sqlid][C1],CarInfo[sqlid][C2],CarInfo[sqlid][JobVehicle],CarInfo[sqlid][Price]);
        printf("%d ),%d,%s,%d,%d,%f,%f,%f,%d,%d,%d,%d",sqlid,CarInfo[sqlid][Owned],CarInfo[sqlid][Owner],CarInfo[sqlid][Faction],CarInfo[sqlid][Model],CarInfo[sqlid][Cx],CarInfo[sqlid][Cy],CarInfo[sqlid][Cz],CarInfo[sqlid][Inc],CarInfo[sqlid][C1],CarInfo[sqlid][C2],CarInfo[sqlid][JobVehicle]);
        AddStaticVehicleEx(blabla)
     }
}
/// REST of the code is ok
LE : Fixed it this mysql_fetch_row(wholeline); should not be there