Moin,
es spawnt nun das Auto, auch wenn es einem nicht gehört, also so oft, wie ien Spieler joint -.-.
Kann man den Code irgendwie anders lösen?
stock LoadCars(playerid)
{
for(new i = 1;i<MAX_AUTOS;i++)
{
new tform[200];
format(tform,sizeof tform,"autos/auto_%d.txt",i);
if(fexist(tform))
{
if(!strcmp(dini_Get(tform,"key"),SpielerName(playerid),true))
{
PlayerAuto[i][vmodel] = dini_Int(tform,"model");
PlayerAuto[i][paX] = dini_Float(tform,"X");
PlayerAuto[i][paY] = dini_Float(tform,"Y");
PlayerAuto[i][paZ] = dini_Float(tform,"Z");
PlayerAuto[i][paA] = dini_Float(tform,"A");
PlayerAuto[i][vfarbe1] = dini_Int(tform,"farbe1");
PlayerAuto[i][vfarbe2] = dini_Int(tform,"farbe2");
PlayerAuto[i][vmod0] = dini_Int(tform,"mod0");
PlayerAuto[i][vmod1] = dini_Int(tform,"mod1");
PlayerAuto[i][vmod2] = dini_Int(tform,"mod2");
PlayerAuto[i][vmod3] = dini_Int(tform,"mod3");
PlayerAuto[i][vmod4] = dini_Int(tform,"mod4");
PlayerAuto[i][vmod5] = dini_Int(tform,"mod5");
PlayerAuto[i][vmod6] = dini_Int(tform,"mod6");
PlayerAuto[i][vmod7] = dini_Int(tform,"mod7");
PlayerAuto[i][vmod8] = dini_Int(tform,"mod8");
PlayerAuto[i][vmod9] = dini_Int(tform,"mod9");
PlayerAuto[i][vmod10] = dini_Int(tform,"mod10");
PlayerAuto[i][vmod11] = dini_Int(tform,"mod11");
PlayerAuto[i][vmod12] = dini_Int(tform,"mod12");
PlayerAuto[i][vmod13] = dini_Int(tform,"mod13");
PlayerAuto[i][kDrogen] = dini_Int(tform,"kDrogen");
PlayerAuto[i][kWaffe1] = dini_Int(tform,"kWaffe1");
PlayerAuto[i][kWaffe2] = dini_Int(tform,"kWaffe2");
PlayerAuto[i][kWaffe1Ammu] = dini_Int(tform,"kWaffe1Ammu");
PlayerAuto[i][kWaffe2Ammu] = dini_Int(tform,"kWaffe2Ammu");
PlayerAuto[i][kState] = dini_Int(tform,"kState");
PlayerAuto[i][Kraftstoff] = dini_Int(tform,"Kraftstoff");
PlayerAuto[i][TankVolumen] = dini_Int(tform,"TankVolumen");
PlayerAuto[i][Angemeldet] = dini_Int(tform,"Angemeldet");
PlayerAuto[i][Abgenommen] = dini_Int(tform,"Abgenommen");
//strmid(PlayerAuto[i][Kennzeichen],dini_Get(tform,"Kennzeichen"),0,30,255);
//SetVehicleNumberPlate(PlayerAuto[i][id_x],PlayerAuto[i][Kennzeichen]);
PlayerAuto[i][paintjob] = dini_Int(tform,"paintjob");
PlayerAuto[i][id_x] =
CreateVehicle(PlayerAuto[i][vmodel],PlayerAuto[i][paX],PlayerAuto[i][paY],PlayerAuto[i][paZ],PlayerAuto[i][paA],PlayerAuto[i][vfarbe1],PlayerAuto[i][vfarbe2],100000000);
Tank[i] = GetGasMax(GetVehicleModel(PlayerAuto[i][id_x]));
FahrzeugTunen(PlayerAuto[i][id_x]);
}
}
}
return 1;
}
Ich weis auch nicht, wie ich die Abfrage machen soll, da der Besitzerstring ja noch nicht geladen ist.
So fragt er in jeder Datei, ob der Key == der Spielername ist.
Und läd dann das Auto, deswegen spawnt es so oft.
Aber wie soll ich die Abfrage hier sonst machen:
if(!strcmp(dini_Get(tform,"key"),SpielerName(playerid),true))
Bitte um schnelle Hilfe!
MfG