22.03.2011, 02:14
(
Последний раз редактировалось Rokzlive; 22.03.2011 в 16:21.
)
Ok, ive never worked with sscanf so i tried to make a loadvehicles stock using the only way i could think of. I tried this but i did not work at all, can someone convert it to sscanf?
pawn Код:
stock LoadVehicles()
{
new Query[255];
for(new id; id < MA; id++)
{
format(Query, sizeof(Query), "SELECT * FROM vehicles WHERE id= %d", id);
mysql_query(Query);
mysql_store_result();
if(mysql_num_rows())
mysql_fetch_field("Model", vehicledata[id][Model]);
mysql_fetch_field("x", vehicledata[id][POS][0]);
mysql_fetch_field("y", vehicledata[id][POS][1]);
mysql_fetch_field("z", vehicledata[id][POS][2]);
mysql_fetch_field("a", vehicledata[id][POS][3]);
mysql_fetch_field("Owner", vehicledata[id][Owner]);
mysql_fetch_field("Forsale", vehicledata[id][Forsale]);
mysql_fetch_field("Price", vehicledata[id][Price]);
new Color1 = random(126); new Color2 = random(126);
CreateVehicle(vehicledata[id][Model],vehicledata[id][POS][0],vehicledata[id][POS][1],vehicledata[id][POS][2],vehicledata[id][POS][3],Color1,Color2, 60*10000);
}
}