Guten Morgen da ich lange lange leider net mehr mit dini und pawn was gemacht habe ist mir auch etwas mein wissen gegangen
ich wollte gerne den user name saven und beim erstellen drauf schreiben lassen auf das car
hier code freue mich über jede hilfe
hier mal angefangen
enum AKinfo
{
autohmodelid,
autohnumplate[10],//hier definirt
Name[54],
preis,
Float:kaufx,
Float:kaufy,
Float:kaufz,
Float:kaufrot,
Float:spawnx,
Float:spawny,
Float:spawnz,
Float:spawnrot
}
laden wen der player kommt
for(new i = 0;i < MAX_PLAYER_CARS;i++)
{
new Car[128];
format(Car,sizeof(Car),"/Car/%s's Auto %d.txt",playername(playerid),i);
if(!dini_Exists(Car)) continue;
{
Autos[playerid][i][Park_x]= dini_Float(Car,"Car_X");
Autos[playerid][i][Park_y]= dini_Float(Car,"Car_y");
Autos[playerid][i][Park_z]= dini_Float(Car,"Car_Z");
Autos[playerid][i][Park_rot]= dini_Float(Car,"Car_ROT");
Autos[playerid][i][Farbe1] = dini_Int(Car,"Farbe1");
Autos[playerid][i][Farbe2] = dini_Int(Car,"Farbe2");
Autos[playerid][i][Paintjob] = dini_Int(Car,"Paintjob");
Autos[playerid][i][carmodelid] = dini_Int(Car,"modelid");
Autos[playerid][i][Spoiler] = dini_Int(Car,"Spoiler");
Autos[playerid][i][Wheels] = dini_Int(Car,"Wheels");
Autos[playerid][i][Nitro] = dini_Int(Car,"Nitro");
Autos[playerid][i][Roof] = dini_Int(Car,"Roof");
Autos[playerid][i][Hood] = dini_Int(Car,"Hood");
Autos[playerid][i][Sideskirt] = dini_Int(Car,"Sideskirt");
Autos[playerid][i][Lamps] = dini_Int(Car,"Lamps");
Autos[playerid][i][Exhaust] = dini_Int(Car,"Exhaust");
Autos[playerid][i][Stereo] = dini_Int(Car,"Stereo");
Autos[playerid][i][Hydraulics] = dini_Int(Car,"Hydraulics");
Autos[playerid][i][VentRight] = dini_Int(Car,"VentRight");
Autos[playerid][i][VentLeft] = dini_Int(Car,"VentLeft");
Autos[playerid][i][FrontBumper] = dini_Int(Car,"FrontBumper");
Autos[playerid][i][RearBumper] = dini_Int(Car,"RearBumper");
Autos[playerid][i][carmodelid] = dini_Int(Car,"modelid");
Autos[playerid][i][preis] = dini_Int(Car,"Preis");
meinauto[playerid][i] = CreateVehicle(Autos[playerid][i][carmodelid],Autos[playerid][i][Park_x],Autos[playerid][i][Park_y],Autos[playerid][i][Park_z],Autos[playerid][i][Park_rot],-1,-1,-1);
if(Autos[playerid][i][Paintjob] >= 0)
{
ChangeVehiclePaintjob(meinauto[playerid][i],Autos[playerid][i][Paintjob]);
}
if(Autos[playerid][i][Farbe1] >= 0 || Autos[playerid][i][Farbe2] >= 0)
{
ChangeVehicleColor(meinauto[playerid][i],Autos[playerid][i][Farbe1],Autos[playerid][i][Farbe2]);
}
if(Autos[playerid][i][Spoiler] >= 1000) { AddVehicleComponent(meinauto[playerid][i],Autos[playerid][i][Spoiler]); }
if(Autos[playerid][i][Hood] >= 1000) { AddVehicleComponent(meinauto[playerid][i],Autos[playerid][i][Hood]); }
if(Autos[playerid][i][Roof] >= 1000) { AddVehicleComponent(meinauto[playerid][i],Autos[playerid][i][Roof]); }
if(Autos[playerid][i][Sideskirt] >= 1000) { AddVehicleComponent(meinauto[playerid][i],Autos[playerid][i][Sideskirt]); }
if(Autos[playerid][i][Lamps] >= 1000) { AddVehicleComponent(meinauto[playerid][i],Autos[playerid][i][Lamps]); }
if(Autos[playerid][i][Nitro] >= 1000) { AddVehicleComponent(meinauto[playerid][i],Autos[playerid][i][Nitro]); }
if(Autos[playerid][i][Exhaust] >= 1000) { AddVehicleComponent(meinauto[playerid][i],Autos[playerid][i][Exhaust]); }
if(Autos[playerid][i][Wheels] >= 1000) { AddVehicleComponent(meinauto[playerid][i],Autos[playerid][i][Wheels]); }
if(Autos[playerid][i][Stereo] >= 1000) { AddVehicleComponent(meinauto[playerid][i],Autos[playerid][i][Stereo]); }
if(Autos[playerid][i][Hydraulics] >= 1000) { AddVehicleComponent(meinauto[playerid][i],Autos[playerid][i][Hydraulics]); }
if(Autos[playerid][i][FrontBumper] >= 1000) { AddVehicleComponent(meinauto[playerid][i],Autos[playerid][i][FrontBumper]); }
if(Autos[playerid][i][RearBumper] >= 1000) { AddVehicleComponent(meinauto[playerid][i],Autos[playerid][i][RearBumper]); }
if(Autos[playerid][i][VentRight] >= 1000) { AddVehicleComponent(meinauto[playerid][i],Autos[playerid][i][VentRight]); }
if(Autos[playerid][i][VentLeft] >= 1000) { AddVehicleComponent(meinauto[playerid][i],Autos[playerid][i][VentLeft]); }
GetVehicleParamsEx(meinauto[playerid][i],ahengine,ahlights,ahalarm,ahdoors,ahbonnet,ahboot,ahobjective);
SetVehicleParamsEx(meinauto[playerid][i],ahengine,ahlights,ahalarm,true,ahbonnet,ahboot,ahobjective);
carlock[meinauto[playerid][i]] = true;
}
}
saven wen er geht
for(new i = 0;i < MAX_PLAYER_CARS;i++)
{
new Car[128];
format(Car,sizeof(Car),"/Car/%s's Auto %d.txt",playername(playerid),i);
if(dini_Exists(Car))
{
dini_FloatSet(Car,"Car_X",Autos[playerid][i][Park_x]);
dini_FloatSet(Car,"Car_y",Autos[playerid][i][Park_y]);
dini_FloatSet(Car,"Car_Z",Autos[playerid][i][Park_z]);
dini_FloatSet(Car,"Car_ROT",Autos[playerid][i][Park_rot]);
dini_IntSet(Car,"Farbe1",Autos[playerid][i][Farbe1]);
dini_IntSet(Car,"Farbe2",Autos[playerid][i][Farbe2]);
dini_IntSet(Car,"Paintjob",Autos[playerid][i][Paintjob]);
dini_IntSet(Car,"Spoiler",GetVehicleComponentInSlot(meinauto[playerid][i],0));
dini_IntSet(Car,"Hood",GetVehicleComponentInSlot(meinauto[playerid][i],1));
dini_IntSet(Car,"Roof",GetVehicleComponentInSlot(meinauto[playerid][i],2));
dini_IntSet(Car,"Sideskirt",GetVehicleComponentInSlot(meinauto[playerid][i],3));
dini_IntSet(Car,"Lamps",GetVehicleComponentInSlot(meinauto[playerid][i],4));
dini_IntSet(Car,"Nitro",GetVehicleComponentInSlot(meinauto[playerid][i],5));
dini_IntSet(Car,"Exhaust",GetVehicleComponentInSlot(meinauto[playerid][i],6));
dini_IntSet(Car,"Wheels",GetVehicleComponentInSlot(meinauto[playerid][i],7));
dini_IntSet(Car,"Stereo",GetVehicleComponentInSlot(meinauto[playerid][i],8));
dini_IntSet(Car,"Hydraulics",GetVehicleComponentInSlot(meinauto[playerid][i],9));
dini_IntSet(Car,"FrontBumper",GetVehicleComponentInSlot(meinauto[playerid][i],10));
dini_IntSet(Car,"RearBumper",GetVehicleComponentInSlot(meinauto[playerid][i],11));
dini_IntSet(Car,"VentRight",GetVehicleComponentInSlot(meinauto[playerid][i],12));
dini_IntSet(Car,"VentLeft",GetVehicleComponentInSlot(meinauto[playerid][i],13));
dini_IntSet(Car,"Modelid",GetVehicleModel(meinauto[playerid][i]));
DestroyVehicle(meinauto[playerid][i]);
}
}
wäre cool wen es mir einer mal ebend machen könnte
ps das sollte helfen
meinauto[playerid][i] = CreateVehicle(Autos[playerid][i][carmodelid],Autos[playerid][i][Park_x],Autos[playerid][i][Park_y],Autos[playerid][i][Park_z],Autos[playerid][i][Park_rot],-1,-1,-1);
hier wirds erstellt für den user