Loading SQL Vehicles
#5

pawn Код:
sscanf(row, "p<|>d",carid);
That won't work as the row isn't just one single ID. I would recommend trying this:

pawn Код:
mysql_query("SELECT * FROM samp_vehicles");
mysql_store_result();
new row[4000], carid;
while(mysql_fetch_row(row))
{
        carid ++;
        sscanf(row, "p<|>e<ddffffdds[64]ds[16]ddddddddddddddddddds[64]d>", CarInfo[carid]);
        ownedcar[carid] = AddStaticVehicle(CarInfo[carid][cModel],CarInfo[carid][cLocationx],CarInfo[carid][cLocationy],CarInfo[carid][cLocationz], CarInfo[carid][cColorOne], CarInfo[carid][cColorTwo],100);  
        if(CarInfo[carid][cPaintjob] != 999)
        {
            ChangeVehiclePaintjob(carid, CarInfo[carid][cPaintjob]);
        }
        SetVehicleVirtualWorld(carid, CarInfo[carid][cVirWorld]);
        SetVehicleNumberPlate(carid, CarInfo[carid][cPlate]);
        SetVehicleModifications(carid);
}
mysql_free_result();
You don't really need the carid's to match up because you always have the carid stored in the enum anyway. Give that a go and see what happens.
Reply


Messages In This Thread
Loading SQL Vehicles - by DaRkM - 12.04.2012, 23:48
Re: Loading SQL Vehicles - by DaRkM - 14.04.2012, 02:54
Re: Loading SQL Vehicles - by [HiC]TheKiller - 14.04.2012, 03:02
Re: Loading SQL Vehicles - by DaRkM - 14.04.2012, 03:33
Re: Loading SQL Vehicles - by [HiC]TheKiller - 14.04.2012, 04:30
Re: Loading SQL Vehicles - by DaRkM - 14.04.2012, 04:50
Re: Loading SQL Vehicles - by [HiC]TheKiller - 14.04.2012, 05:37
Re: Loading SQL Vehicles - by DaRkM - 14.04.2012, 05:57
Re: Loading SQL Vehicles - by [HiC]TheKiller - 14.04.2012, 06:03
Re: Loading SQL Vehicles - by DaRkM - 14.04.2012, 06:15

Forum Jump:


Users browsing this thread: 1 Guest(s)