Guten Abend,
Und zwar wenn der Server restartet und die Fraktionsfahrzeuge spawnen, spawnen die falsch an der stelle.
Und wenn /respawnallcars eingebe spawnt das Fahrzeug perfekt auf die Stelle.
Code:
public LoadFVehicles(connectionHandle)
{
new rows,fields;
cache_get_data(rows, fields);
new fv = 0;
if(rows)
{
while(fv < rows)
{
// laden
new nPlate[32];
fVehicle[fv][dbID] = cache_get_field_content_int(fv, "id", connectionHandle);
fVehicle[fv][vehFraktion] = cache_get_field_content_int(fv, "vehFraktion", connectionHandle);
fVehicle[fv][modelid] = cache_get_field_content_int(fv, "modelid", connectionHandle);
fVehicle[fv][vehPosX] = cache_get_field_content_float(fv, "vehPosX",connectionHandle);
fVehicle[fv][vehPosY] = cache_get_field_content_float(fv, "vehPosY",connectionHandle);
fVehicle[fv][vehPosZ] = cache_get_field_content_float(fv, "vehPosZ",connectionHandle);
fVehicle[fv][vehPosA] = cache_get_field_content_float(fv, "vehPosA",connectionHandle);
fVehicle[fv][vehHealth] = cache_get_field_content_float(fv, "vehHealth",connectionHandle);
fVehicle[fv][vehColor1] = cache_get_field_content_int(fv, "vehColor1",connectionHandle);
fVehicle[fv][vehColor2] = cache_get_field_content_int(fv, "vehColor2",connectionHandle);
cache_get_field_content(fv,"vehNumberPlate", fVehicle[fv][vehNumberPlate],mycon,15);
fVehicle[fv][vehID] = CreateVehicleEx(fVehicle[fv][modelid],fVehicle[fv][vehPosX],fVehicle[fv][vehPosY],fVehicle[fv][vehPosZ],fVehicle[fv][vehPosA],fVehicle[fv][vehColor1],fVehicle[fv][vehColor2],-1,false);
Vehicle[fVehicle[fv][vehID]][vehFuel] = cache_get_field_content_float(fv, "vehFuel",connectionHandle);
Vehicle[fVehicle[fv][vehID]][vehKMStand] = cache_get_field_content_float(fv, "vehKMStand",connectionHandle);
Vehicle[fVehicle[fv][vehID]][vehInterior] = cache_get_field_content_int(fv, "vehInterior",connectionHandle);
Vehicle[fVehicle[fv][vehID]][vehWorld] = cache_get_field_content_int(fv, "vehWorld",connectionHandle);
format(nPlate, sizeof(nPlate),"%s",fVehicle[fv][vehNumberPlate]);
SetVehicleNumberPlate(fVehicle[fv][vehID],nPlate);
fv++;
}
}
printf("[LOAD] Frakfahrzeuge wurden geladen (%d/%d)", rows, MAX_FVEHS);
return 1;
}
Jeffry: