Hier ein Beispiel wie ich meine Autos lade, es wird so ziemlich alles geladen und gespeichert was möglich ist(schladensmodell mach ich heute)
for(new i = 1; i <=MAX_VEHICLES; i++)
{
format(Autodatei,50,"/Autos/%d.txt",i);
if(!fexist(Autodatei))
{
format(Vehicle[i][Nummernschild],50,"0");
}
else
{
Vehicle[i][modelid] = dini_Int(Autodatei,"modelid");
Vehicle[i][HP] = dini_Int(Autodatei,"HP");
format(Vehicle[i][Nummernschild],50,dini_Get(Autodatei,"Nummernschild"));
Vehicle[i][Farbe1] = dini_Int(Autodatei,"Farbe1");
Vehicle[i][Farbe2] = dini_Int(Autodatei,"Farbe2");
Vehicle[i][Paintjob] = dini_Int(Autodatei,"Paintjob");
Vehicle[i][posx] = dini_Int(Autodatei,"posx");
Vehicle[i][posy] = dini_Int(Autodatei,"posy");
Vehicle[i][posz] = dini_Int(Autodatei,"posz");
Vehicle[i][posa] = dini_Int(Autodatei,"posa");
Vehicle[i][Abgeschlossen] = dini_Int(Autodatei,"Abgeschlossen");
Vehicle[i][engine] = dini_Int(Autodatei,"engine");
Vehicle[i][bonnet] = dini_Int(Autodatei,"bonnet");
Vehicle[i][lights] = dini_Int(Autodatei,"lights");
Vehicle[i][alarm] = dini_Int(Autodatei,"alarm");
Vehicle[i][boot] = dini_Int(Autodatei,"boot");
Vehicle[i][Spoiler] = dini_Int(Autodatei,"Spoiler");
Vehicle[i][Wheels] = dini_Int(Autodatei,"Wheels");
Vehicle[i][Nitro] = dini_Int(Autodatei,"Nitro");
Vehicle[i][Roof] = dini_Int(Autodatei,"Roof");
Vehicle[i][Hood] = dini_Int(Autodatei,"Hood");
Vehicle[i][Sideskirt] = dini_Int(Autodatei,"Sideskirt");
Vehicle[i][Lamps] = dini_Int(Autodatei,"Lamps");
Vehicle[i][Exhaust] = dini_Int(Autodatei,"Exhaust");
Vehicle[i][Stereo] = dini_Int(Autodatei,"Stereo");
Vehicle[i][Hydraulics] = dini_Int(Autodatei,"Hydraulics");
Vehicle[i][VentRight] = dini_Int(Autodatei,"VentRight");
Vehicle[i][VentLeft] = dini_Int(Autodatei,"VentLeft");
Vehicle[i][FrontBumper] = dini_Int(Autodatei,"FrontBumper");
Vehicle[i][RearBumper] = dini_Int(Autodatei,"RearBumper");
car[i]=CreateVehicle(Vehicle[i][modelid],Vehicle[i][posx],Vehicle[i][posy],Vehicle[i][posz]+1.5,Vehicle[i][posa],-1,-1,-1);
SetVehicleNumberPlate(car[i],dini_Get(Autodatei,"Nummernschild"));
SetVehicleHealth(car[i],Vehicle[i][HP]);
SetVehicleParamsEx(car[i],Vehicle[i][engine],Vehicle[i][lights],0,Vehicle[i][Abgeschlossen],Vehicle[i][bonnet],Vehicle[i][boot],0);
if(Vehicle[i][Paintjob] >= 0)
{
ChangeVehiclePaintjob(car[i],Vehicle[i][Paintjob]);
}
if(Vehicle[i][Farbe1] >= 0 || Vehicle[i][Farbe2] >= 0)
{
ChangeVehicleColor(car[i],Vehicle[i][Farbe1],Vehicle[i][Farbe2]);
}
if(Vehicle[i][Spoiler] >= 1000) { AddVehicleComponent(car[i],Vehicle[i][Spoiler]); }
if(Vehicle[i][Hood] >= 1000) { AddVehicleComponent(car[i],Vehicle[i][Hood]); }
if(Vehicle[i][Roof] >= 1000) { AddVehicleComponent(car[i],Vehicle[i][Roof]); }
if(Vehicle[i][Sideskirt] >= 1000) { AddVehicleComponent(car[i],Vehicle[i][Sideskirt]); }
if(Vehicle[i][Lamps] >= 1000) { AddVehicleComponent(car[i],Vehicle[i][Lamps]); }
if(Vehicle[i][Nitro] >= 1000) { AddVehicleComponent(car[i],Vehicle[i][Nitro]); }
if(Vehicle[i][Exhaust] >= 1000) { AddVehicleComponent(car[i],Vehicle[i][Exhaust]); }
if(Vehicle[i][Wheels] >= 1000) { AddVehicleComponent(car[i],Vehicle[i][Wheels]); }
if(Vehicle[i][Stereo] >= 1000) { AddVehicleComponent(car[i],Vehicle[i][Stereo]); }
if(Vehicle[i][Hydraulics] >= 1000) { AddVehicleComponent(car[i],Vehicle[i][Hydraulics]); }
if(Vehicle[i][FrontBumper] >= 1000) { AddVehicleComponent(car[i],Vehicle[i][FrontBumper]); }
if(Vehicle[i][RearBumper] >= 1000) { AddVehicleComponent(car[i],Vehicle[i][RearBumper]); }
if(Vehicle[i][VentRight] >= 1000) { AddVehicleComponent(car[i],Vehicle[i][VentRight]); }
if(Vehicle[i][VentLeft] >= 1000) { AddVehicleComponent(car[i],Vehicle[i][VentLeft]); }
}
}