Teste es bitte so:
forward LoadCars_Data();
public LoadCars_Data()
{
new rows, id, createdVehs;
rows = cache_num_rows();
for(new i=0; i<rows; i++)
{
id = cache_get_field_content_int(i, "id");
if(id < 0 || id >= sizeof(CarInfo)) continue;
cache_get_field_content(i, "Besitzer", CarInfo[id][Besitzer],handle,34);
CarInfo[id][modelID] = cache_get_field_content_int(i, "ModelID");
CarInfo[id][c_x] = cache_get_field_content_float(i, "PosX");
CarInfo[id][c_y] = cache_get_field_content_float(i, "PosY");
CarInfo[id][c_z] = cache_get_field_content_float(i, "PosZ");
CarInfo[id][c_a] = cache_get_field_content_float(i, "PosA");
CarInfo[id][c_color1] = cache_get_field_content_int(i, "Color1");
CarInfo[id][c_color2] = cache_get_field_content_int(i, "Color2");
CarInfo[id][c_Preis] = cache_get_field_content_int(i, "Preis");
CarInfo[id][c_Gekauft] = cache_get_field_content_int(i, "Gekauft");
CarInfo[id][c_Versicherung] = cache_get_field_content_int(i, "Versicherung");
if(CarInfo[id][modelID] >= 400 && CarInfo[id][modelID] <= 611)
{
new text[64];
CarInfo[id][c_vID] = CreateVehicle(CarInfo[id][modelID], CarInfo[id][c_x], CarInfo[id][c_y], CarInfo[id][c_z], CarInfo[id][c_a], CarInfo[id][c_color1], CarInfo[id][c_color2], -1);
format(text, sizeof(text), "Besitzer: %s\nKaufpreis: %d\nReparier Kosten: %d",CarInfo[id][Besitzer],CarInfo[id][c_Preis], CarInfo[id][c_Preis] / 10);
CarInfo[id][Carlable] = Create3DTextLabel(text,0x0FFF00FF,CarInfo[id][c_x], CarInfo[id][c_y], CarInfo[id][c_z],20.0,0,1);
Attach3DTextLabelToVehicle(CarInfo[id][Carlable],CarInfo[id][modelID], 0.0, 0.0, 2.0);
}
else
{
printf("[Error] Model-ID %d existiert nicht (ID: %d).", CarInfo[id][modelID], id);
}
if(GetVehicleModel(MAX_VEHICLES-1) != 0) return print("Es können keine weiteren Fahrzeuge geladen werden, Limit (MAX_VEHICLES) erreicht.");
createdVehs++;
if(createdVehs == MAX_AUTOS) return print("Es können keine weiteren Fahrzeuge geladen werden, Limit (MAX_AUTOS) erreicht.");
}
return 1;
}
public LoadCars_Data()
{
new rows, id, createdVehs;
rows = cache_num_rows();
for(new i=0; i<rows; i++)
{
id = cache_get_field_content_int(i, "id");
if(id < 0 || id >= sizeof(CarInfo)) continue;
cache_get_field_content(i, "Besitzer", CarInfo[id][Besitzer],handle,34);
CarInfo[id][modelID] = cache_get_field_content_int(i, "ModelID");
CarInfo[id][c_x] = cache_get_field_content_float(i, "PosX");
CarInfo[id][c_y] = cache_get_field_content_float(i, "PosY");
CarInfo[id][c_z] = cache_get_field_content_float(i, "PosZ");
CarInfo[id][c_a] = cache_get_field_content_float(i, "PosA");
CarInfo[id][c_color1] = cache_get_field_content_int(i, "Color1");
CarInfo[id][c_color2] = cache_get_field_content_int(i, "Color2");
CarInfo[id][c_Preis] = cache_get_field_content_int(i, "Preis");
CarInfo[id][c_Gekauft] = cache_get_field_content_int(i, "Gekauft");
CarInfo[id][c_Versicherung] = cache_get_field_content_int(i, "Versicherung");
if(CarInfo[id][modelID] >= 400 && CarInfo[id][modelID] <= 611)
{
new text[64];
CarInfo[id][c_vID] = CreateVehicle(CarInfo[id][modelID], CarInfo[id][c_x], CarInfo[id][c_y], CarInfo[id][c_z], CarInfo[id][c_a], CarInfo[id][c_color1], CarInfo[id][c_color2], -1);
format(text, sizeof(text), "Besitzer: %s\nKaufpreis: %d\nReparier Kosten: %d",CarInfo[id][Besitzer],CarInfo[id][c_Preis], CarInfo[id][c_Preis] / 10);
CarInfo[id][Carlable] = Create3DTextLabel(text,0x0FFF00FF,CarInfo[id][c_x], CarInfo[id][c_y], CarInfo[id][c_z],20.0,0,1);
Attach3DTextLabelToVehicle(CarInfo[id][Carlable],CarInfo[id][modelID], 0.0, 0.0, 2.0);
}
else
{
printf("[Error] Model-ID %d existiert nicht (ID: %d).", CarInfo[id][modelID], id);
}
if(GetVehicleModel(MAX_VEHICLES-1) != 0) return print("Es können keine weiteren Fahrzeuge geladen werden, Limit (MAX_VEHICLES) erreicht.");
createdVehs++;
if(createdVehs == MAX_AUTOS) return print("Es können keine weiteren Fahrzeuge geladen werden, Limit (MAX_AUTOS) erreicht.");
}
return 1;
}
Dann dürfte es gehen.