08.08.2011, 06:07
pawn Код:
for(new ca = 0; ca < 200; ca++)
{
new data[256], query[512], string[256];
new aux[50][12];
format(query, sizeof(query), "SELECT * FROM `vehicles` WHERE CarID = %d",ca);
mysql_query(query);
mysql_store_result();
printf("step1");
//if(mysql_num_rows() > 0)
//{
//if(strmatch(VehicleSystem[h][Owner],"Unbought")) return 1;
Globalcarid++;
mysql_fetch_row_format(data);
splitGF(data, aux, '|');
VehicleSystem[ca][CarID]=strval(aux[0]);
printf("lalala");
VehicleSystem[ca][Model]=strval(aux[1]);
VehicleSystem[ca][Locked]=strval(aux[2]);
VehicleSystem[ca][Carx]=floatstr(aux[3]);
VehicleSystem[ca][Cary]=floatstr(aux[4]);
VehicleSystem[ca][Carz]=floatstr(aux[5]);
VehicleSystem[ca][Cara]=floatstr(aux[6]);
VehicleSystem[ca][Color1]=strval(aux[7]);
VehicleSystem[ca][Color2]=strval(aux[8]);
VehicleSystem[ca][Price]=strval(aux[9]);
VehicleSystem[ca][Sell]=strval(aux[10]);
format(string, sizeof(string), "%s loaded", ca);
printf(string);
strmid(VehicleSystem[ca][Owner],aux[11],0,20,20);
//VehicleSystem[ca][Owner] = aux[11];
new carr = CreateVehicle(VehicleSystem[ca][Model],VehicleSystem[ca][Carx],VehicleSystem[ca][Cary],VehicleSystem[ca][Carz]+5,VehicleSystem[ca][Cara],VehicleSystem[ca][Color1],VehicleSystem[ca][Color2],600000);
IsBuyableCar[carr]=ca;
printf("step3");
SaveMYSQLCarID(carr);
printf("step4");
//}
}