13.11.2010, 15:24
(
Последний раз редактировалось Typhome; 13.11.2010 в 21:46.
)
Figure it out.
public LoadCar() // mySQL
{
MySQLCheckConnection();
mysql_query("SELECT * FROM cars");
mysql_store_result();
new result[1024], car[29][64];
print("LoadCar - Passed number: Start");
for(new idx = 115; idx < CARINFOMAX; idx++)
{
print("LoadCar - Passed number: (1>2)");
printf("Loading Vehicle Data id %d",idx);
mysql_fetch_row_format(result, "|");
split(result, car, '|');
CarInfo[idx][cModel] = strval(car[0]);
CarInfo[idx][cLocationx] = floatstr(car[1]);
CarInfo[idx][cLocationy] = floatstr(car[2]);
CarInfo[idx][cLocationz] = floatstr(car[3]);
CarInfo[idx][cAngle] = floatstr(car[4]);
CarInfo[idx][cColorOne] = strval(car[5]);
CarInfo[idx][cColorTwo] = strval(car[6]);
strmid(CarInfo[idx][cOwner], car[7], 0, strlen(car[7]), 255);
strmid(CarInfo[idx][cDescription], car[8], 0, strlen(car[8]), 255);
CarInfo[idx][cValue] = strval(car[9]);
CarInfo[idx][cOwned] = strval(car[10]);
CarInfo[idx][cPaintjob] = strval(car[11]);
CarInfo[idx][cmod1] = strval(car[12]);
CarInfo[idx][cmod2] = strval(car[13]);
CarInfo[idx][cmod3] = strval(car[14]);
CarInfo[idx][cmod4] = strval(car[15]);
CarInfo[idx][cmod5] = strval(car[16]);
CarInfo[idx][cmod6] = strval(car[17]);
CarInfo[idx][cmod7] = strval(car[18]);
CarInfo[idx][cmod8] = strval(car[19]);
CarInfo[idx][cmod9] = strval(car[20]);
CarInfo[idx][cmod10] = strval(car[21]);
CarInfo[idx][cmod11] = strval(car[22]);
CarInfo[idx][cmod12] = strval(car[23]);
CarInfo[idx][cmod13] = strval(car[24]);
CarInfo[idx][cmod14] = strval(car[25]);
CarInfo[idx][cmod15] = strval(car[26]);
CarInfo[idx][cmod16] = strval(car[27]);
CarInfo[idx][cmod17] = strval(car[28]);
print("LoadCar - Passed number: 3");
AddStaticVehicleEx(strval(car[0]), floatstr(car[1]), floatstr(car[2]), floatstr(car[3]), floatstr(car[4]), strval(car[5]), strval(car[6]), 60000);
printf("Car data: %d %f %f %f %f %d %d", strval(car[0]), floatstr(car[1]), floatstr(car[2]), floatstr(car[3]), floatstr(car[4]), strval(car[5]), strval(car[6]));
print("LoadCar - Passed number: (4>5)");
}
mysql_free_result();
print("LoadCar - Passed number: End");
return 1;
}