Hey,
folgendes Problem:
Ich erstelle beim Serverstart alle Fraktionsautos (24 Stück). Diese spawnen aber nicht an den eingetragenen "Spawnpunkten" (siehe Bild).
Alle Koordinaten werden aber richtig ausgelesen aus der DB.
Code
void LoadFVehicles()
{
new rows,fields;
cache_get_data(rows, fields);
new fv = 0;
if(rows)
{
while(fv < rows)
{
// laden
fVehicle[fv][dbID] = cache_get_field_content_int(fv, "id", dbhandle);
fVehicle[fv][vehFraktion] = cache_get_field_content_int(fv, "vehFraktion", dbhandle);
fVehicle[fv][modelid] = cache_get_field_content_int(fv, "modelid", dbhandle);
fVehicle[fv][vehPosX] = cache_get_field_content_float(fv, "vehPosX", dbhandle);
fVehicle[fv][vehPosY] = cache_get_field_content_float(fv, "vehPosY", dbhandle);
fVehicle[fv][vehPosZ] = cache_get_field_content_float(fv, "vehPosZ", dbhandle);
fVehicle[fv][vehPosA] = cache_get_field_content_float(fv, "vehPosA", dbhandle);
fVehicle[fv][vehColor1] = cache_get_field_content_int(fv, "vehColor1", dbhandle);
fVehicle[fv][vehColor2] = cache_get_field_content_int(fv, "vehColor2", dbhandle);
cache_get_field_content(fv, "vehNumberPlate", fVehicle[fv][vehNumberPlate], dbhandle, 32);
fVehicle[fv][vehID] = CreateVehicle(fVehicle[fv][modelid], fVehicle[fv][vehPosX], fVehicle[fv][vehPosY], fVehicle[fv][vehPosZ], fVehicle[fv][vehPosA], fVehicle[fv][vehColor1], fVehicle[fv][vehColor2], 35000);
//printf("fVehicle ID: %d (fVeh fraktion: %d), pos: %0.2f, %0.2f, %0.2f",fVehicle[fv][vehID], fVehicle[fv][vehFraktion], fVehicle[fv][vehPosX], fVehicle[fv][vehPosY], fVehicle[fv][vehPosZ]);
SetVehicleNumberPlate(fVehicle[fv][vehID], fVehicle[fv][vehNumberPlate]);
fv++;
}
}
printf("[LOAD] Fraktionsfahrzeuge: %i/%i", rows, MAX_FVEHICLES);
mysql_free_result();
return 1;
}
Alles anzeigen