12.01.2012, 10:31
pawn Код:
stock initiateCars()
{
for(new id = 1; id < sizeof(CarInfo); id++)
{
format(Query, sizeof(Query), "SELECT * FROM `cars` WHERE `id` = %d", id);
mysql_query(Query);
mysql_store_result();
if(!mysql_num_rows()) continue;
if(mysql_fetch_row_format(Query, "|"))
{
sscanf(Query, "p<|>e<is[24]ffffffffiis[24]s[24]is[32]s[32]iiiiiiiiiiiiiiiiiiiii>", CarInfo[id]);
CreateVehicle(CarInfo[id][cModel], CarInfo[id][cLocationx], CarInfo[id][cLocationy], CarInfo[id][cLocationz]+1.0, CarInfo[id][cAngle], CarInfo[id][cColorOne], CarInfo[id][cColorTwo], 600000);
gCarLock[id] = 1;
SetVehicleNumberPlate(id, CarInfo[id][cLicense]);
LoadComponents(id);
}
}
mysql_free_result();
return 1;
}
Okay, fixed it, it was because I was using onqueryfinish(not sure why) but the cars won't spawn, why?