Hi,
Vorm Restart spawnt das Fahrzeug immer da, wo es geparkt wurde.
Nur danach beim Strand in LS.
Es werden die Fahrzeuge bei jedem Restart gespeichert.
ZitatAlles anzeigenpublic LoadFractionCars(){
if(!fexist(Fraction_Car_File)){
new File:tfFile=fopen(Fraction_Car_File,io_write);
fclose(tfFile);
}
new File:fFile=fopen(Fraction_Car_File,io_read),Content[512],fc;
while(fread(fFile,Content)){
StripNewLine(Content);
sscanf(Content,"dffffddddddd",FractionCars[fc][fVehid],FractionCars[fc][fPos][0],FractionCars[fc][fPos][1],FractionCars[fc][fPos][2],FractionCars[fc][fPos][3],FractionCars[fc][fCol][0],FractionCars[fc][fCol][1],FractionCars[fc][fFraction][0],FractionCars[fc][fFraction][1],FractionCars[fc][fFraction][2],FractionCars[fc][fFraction][3],FractionCars[fc][fFraction][4]);
if(FractionCars[fc][fVehid] >= 400 && FractionCars[fc][fVehid] <= 611)
{
FractionCars[fc][fCarid] = CreateVehicle(FractionCars[fc][fVehid],FractionCars[fc][fPos][0],FractionCars[fc][fPos][1],FractionCars[fc][fPos][2],FractionCars[fc][fPos][3],FractionCars[fc][fCol][0],FractionCars[fc][fCol][1],-255);
FractionCars[fc][fLock] = false;
fc++;
}
}
fclose(fFile);
return printf(" '%d' Fraktionsfahrzeug(e) wurden geladen & erstellt.",fc);
}
public SaveFractionCars(){
if(fexist(Fraction_Car_File)) fremove(Fraction_Car_File);
new File:fFile=fopen(Fraction_Car_File,io_append),Content[512];
new fc;while(fc<MAX_FRACTION_CARS){
if(FractionCars[fc][fVehid] >= 400 && FractionCars[fc][fVehid] <= 611){
format(Content,sizeof(Content),"%d %.3f %.3f %.3f %.3f %03d %03d %02d %02d %02d %02d %02d\r\n",FractionCars[fc][fVehid],FractionCars[fc][fPos][0],FractionCars[fc][fPos][1],FractionCars[fc][fPos][2],FractionCars[fc][fPos][3],FractionCars[fc][fCol][0],FractionCars[fc][fCol][1],FractionCars[fc][fFraction][0],FractionCars[fc][fFraction][1],FractionCars[fc][fFraction][2],FractionCars[fc][fFraction][3],FractionCars[fc][fFraction][4]);
fwrite(fFile,Content);
}fc++;
}return fclose(fFile);
}
MFG