MySQL Load car problems
#1

pawn Код:
forward LoadCityCars();
public LoadCityCars()
{
    new sql[64], car[10][64], row[255];
    new totalcars;
    format(sql, sizeof(sql), "SELECT COUNT(*) FROM Vehicles");
    mysql_query(sql);
    mysql_store_result();
    mysql_fetch_row(row);
    totalcars = strvalEx(row);
    mysql_free_result();
    for (new i=0; i<=totalcars; i++)
    {
        format(sql, sizeof(sql), "SELECT * FROM Vehicles WHERE carid=%d", i);
        mysql_query(sql);
        mysql_store_result();
        mysql_fetch_row(row);
        split(row, car, '|');
        mysql_free_result();
        AddStaticVehicleEx(strvalEx(car[1]), strvalEx(car[2]), strvalEx(car[3]), strvalEx(car[4]), strvalEx(car[5]),strvalEx(car[6]), strvalEx(car[7]), 2500000);
        VehicleInfo[i][CarModel] = strvalEx(car[1]);
        VehicleInfo[i][CarX] = strvalEx(car[2]);
        VehicleInfo[i][CarY] = strvalEx(car[3]);
        VehicleInfo[i][CarZ] = strvalEx(car[4]);
        VehicleInfo[i][CarAngle] = strvalEx(car[5]);
        VehicleInfo[i][CarColor1] = strvalEx(car[6]);
        VehicleInfo[i][CarColor2] = strvalEx(car[7]);
        VehicleInfo[i][FactionCar] = strvalEx(car[8]);
        VehicleInfo[i][CarType] = strvalEx(car[9]);
    }
}
This isn't working as it should, it sets the FactionCar to every vehicle that spawns, so i cant enter any vehicles.
I know i did a fix for this in my old mysql load thing, could anybody help me out ?
Reply


Messages In This Thread
MySQL Load car problems - by Johndaonee - 07.11.2010, 01:26
Re: MySQL Load car problems - by baske007 - 07.11.2010, 08:11
Re: MySQL Load car problems - by iJumbo - 07.11.2010, 08:46
Re: MySQL Load car problems - by Johndaonee - 07.11.2010, 12:30

Forum Jump:


Users browsing this thread: 1 Guest(s)