Hallo Breadys,
es gibt gerade folgendes Problem, dass ich die Funktion "LoadVehicles();" geschrieben habe,
aber es werden keine Autos geladen, obwohl sie in der Datenbank stehen:
stock LoadVehicles()
{
new query[20];
format(query,128,"SELECT * FROM cars");
mysql_query(query);
for(new i=0; i<mysql_num_rows(); i++)
{
if(mysql_num_rows()>0)
{
new data[64];
mysql_fetch_field_row(data,"x");
CarInfo[i][car_x] = floatstr(data);
mysql_fetch_field_row(data,"y");
CarInfo[i][car_y] = floatstr(data);
mysql_fetch_field_row(data,"z");
CarInfo[i][car_z] = floatstr(data);
mysql_fetch_field_row(data,"a");
CarInfo[i][car_a] = floatstr(data);
mysql_fetch_field_row(data,"modelid");
CarInfo[i][mid] = strval(data);
mysql_fetch_field_row(data,"color_1");
CarInfo[i][color_1] = strval(data);
mysql_fetch_field_row(data,"color_2");
CarInfo[i][color_2] = strval(data);
mysql_fetch_field_row(data,"cid");
CarInfo[i][cid] = strval(data);
mysql_fetch_field_row(data,"schaden");
{
new query[20];
format(query,128,"SELECT * FROM cars");
mysql_query(query);
for(new i=0; i<mysql_num_rows(); i++)
{
if(mysql_num_rows()>0)
{
new data[64];
mysql_fetch_field_row(data,"x");
CarInfo[i][car_x] = floatstr(data);
mysql_fetch_field_row(data,"y");
CarInfo[i][car_y] = floatstr(data);
mysql_fetch_field_row(data,"z");
CarInfo[i][car_z] = floatstr(data);
mysql_fetch_field_row(data,"a");
CarInfo[i][car_a] = floatstr(data);
mysql_fetch_field_row(data,"modelid");
CarInfo[i][mid] = strval(data);
mysql_fetch_field_row(data,"color_1");
CarInfo[i][color_1] = strval(data);
mysql_fetch_field_row(data,"color_2");
CarInfo[i][color_2] = strval(data);
mysql_fetch_field_row(data,"cid");
CarInfo[i][cid] = strval(data);
mysql_fetch_field_row(data,"schaden");
CarInfo[i][vehid]=CreateVehicle(CarInfo[i][mid],CarInfo[i][car_x],CarInfo[i][car_y],CarInfo[i][car_z],CarInfo[i][car_a],CarInfo[i][color_1],CarInfo[i][color_2],-1);
SetVehicleHealth(CarInfo[i][vehid],floatstr(data));
strdel(data,0,64);
}
}
return 1;
}
SetVehicleHealth(CarInfo[i][vehid],floatstr(data));
strdel(data,0,64);
}
}
return 1;
}
Kann mir evtl. einer sagen, woran das liegt?