Hi,
ich habe bei meinem Fahrzeug system gerade gemerkt das nicht alle tuning Teile gespeichert werden, bei meinem Jester waren zB alle Tuningteile weg ausser der paintjob und die farbe ...
Hier sind einmal die Codes:
//Enum ganz oben
enum Car_System
{
cID,
cModel,
Float:cX,
Float:cY,
Float:cZ,
Float:cR,
tuning_0,
tuning_1,
tuning_2,
tuning_3,
tuning_4,
tuning_5,
tuning_6,
tuning_7,
tuning_8,
tuning_9,
tuning_10,
tuning_11,
tuning_12,
tuning_13,
color_1,
color_2,
paintjob,
}
new CarInfo[MAX_VEHICLES][Car_System];
//Im OnGameModeInit zum laden
for(new i = 1; i < MAX_VEHICLES; i++)//FAHRZEUGE
{
new string[32];
format(string, sizeof(string), "/Vehicles/%d.car", i);
if(dini_Int(string, "cID") > 0)
{
LadeFahrzeug(i);
CreateVehicle(CarInfo[i][cModel], CarInfo[i][cX], CarInfo[i][cY], CarInfo[i][cZ], CarInfo[i][cR],0, 0, -1);
new vehicleid = i;
if(CarInfo[vehicleid][tuning_1] > 999){
AddVehicleComponent(vehicleid, CarInfo[vehicleid][tuning_1]);
} else if(CarInfo[vehicleid][tuning_2] > 999){
AddVehicleComponent(vehicleid, CarInfo[vehicleid][tuning_2]);
} else if(CarInfo[vehicleid][tuning_3] > 999){
AddVehicleComponent(vehicleid, CarInfo[vehicleid][tuning_3]);
} else if(CarInfo[vehicleid][tuning_4] > 999){
AddVehicleComponent(vehicleid, CarInfo[vehicleid][tuning_4]);
} else if(CarInfo[vehicleid][tuning_5] > 999){
AddVehicleComponent(vehicleid, CarInfo[vehicleid][tuning_5]);
} else if(CarInfo[vehicleid][tuning_6] > 999){
AddVehicleComponent(vehicleid, CarInfo[vehicleid][tuning_6]);
} else if(CarInfo[vehicleid][tuning_7] > 999){
AddVehicleComponent(vehicleid, CarInfo[vehicleid][tuning_7]);
} else if(CarInfo[vehicleid][tuning_8] > 999){
AddVehicleComponent(vehicleid, CarInfo[vehicleid][tuning_8]);
} else if(CarInfo[vehicleid][tuning_9] > 999){
AddVehicleComponent(vehicleid, CarInfo[vehicleid][tuning_9]);
} else if(CarInfo[vehicleid][tuning_10] > 999){
AddVehicleComponent(vehicleid, CarInfo[vehicleid][tuning_10]);
} else if(CarInfo[vehicleid][tuning_11] > 999){
AddVehicleComponent(vehicleid, CarInfo[vehicleid][tuning_11]);
} else if(CarInfo[vehicleid][tuning_12] > 999){
AddVehicleComponent(vehicleid, CarInfo[vehicleid][tuning_12]);
} else if(CarInfo[vehicleid][tuning_13] > 999){
AddVehicleComponent(vehicleid, CarInfo[vehicleid][tuning_13]);
}
if(CarInfo[vehicleid][paintjob] > 0){
ChangeVehiclePaintjob(vehicleid, CarInfo[vehicleid][paintjob]);
}
ChangeVehicleColor(vehicleid, CarInfo[vehicleid][color_1], CarInfo[vehicleid][color_1]);
}
}
//OnGameModeExit zum speichern
for(new i = 1; i < MAX_VEHICLES; i++)//FAHRZEUGE
{
SpeicherFahrzeug(i);
}
//OnVehicleSpawn
SetVehiclePos(vehicleid, CarInfo[vehicleid][cX], CarInfo[vehicleid][cY], CarInfo[vehicleid][cZ]);
SetVehicleZAngle(vehicleid, CarInfo[vehicleid][cR]);
if(CarInfo[vehicleid][tuning_1] > 999){
AddVehicleComponent(vehicleid, CarInfo[vehicleid][tuning_1]);
} else if(CarInfo[vehicleid][tuning_2] > 999){
AddVehicleComponent(vehicleid, CarInfo[vehicleid][tuning_2]);
} else if(CarInfo[vehicleid][tuning_3] > 999){
AddVehicleComponent(vehicleid, CarInfo[vehicleid][tuning_3]);
} else if(CarInfo[vehicleid][tuning_4] > 999){
AddVehicleComponent(vehicleid, CarInfo[vehicleid][tuning_4]);
} else if(CarInfo[vehicleid][tuning_5] > 999){
AddVehicleComponent(vehicleid, CarInfo[vehicleid][tuning_5]);
} else if(CarInfo[vehicleid][tuning_6] > 999){
AddVehicleComponent(vehicleid, CarInfo[vehicleid][tuning_6]);
} else if(CarInfo[vehicleid][tuning_7] > 999){
AddVehicleComponent(vehicleid, CarInfo[vehicleid][tuning_7]);
} else if(CarInfo[vehicleid][tuning_8] > 999){
AddVehicleComponent(vehicleid, CarInfo[vehicleid][tuning_8]);
} else if(CarInfo[vehicleid][tuning_9] > 999){
AddVehicleComponent(vehicleid, CarInfo[vehicleid][tuning_9]);
} else if(CarInfo[vehicleid][tuning_10] > 999){
AddVehicleComponent(vehicleid, CarInfo[vehicleid][tuning_10]);
} else if(CarInfo[vehicleid][tuning_11] > 999){
AddVehicleComponent(vehicleid, CarInfo[vehicleid][tuning_11]);
} else if(CarInfo[vehicleid][tuning_12] > 999){
AddVehicleComponent(vehicleid, CarInfo[vehicleid][tuning_12]);
} else if(CarInfo[vehicleid][tuning_13] > 999){
AddVehicleComponent(vehicleid, CarInfo[vehicleid][tuning_13]);
}
if(CarInfo[vehicleid][paintjob] > 0){
ChangeVehiclePaintjob(vehicleid, CarInfo[vehicleid][paintjob]);
}
ChangeVehicleColor(vehicleid, CarInfo[vehicleid][color_1], CarInfo[vehicleid][color_1]);
//OnVehicleMod
if(CarInfo[vehicleid][tuning_0] < 1000){
CarInfo[vehicleid][tuning_0] = componentid;
} else if(CarInfo[vehicleid][tuning_1] < 1000){
CarInfo[vehicleid][tuning_1] = componentid;
} else if(CarInfo[vehicleid][tuning_2] < 1000){
CarInfo[vehicleid][tuning_2] = componentid;
} else if(CarInfo[vehicleid][tuning_3] < 1000){
CarInfo[vehicleid][tuning_3] = componentid;
} else if(CarInfo[vehicleid][tuning_4] < 1000){
CarInfo[vehicleid][tuning_4] = componentid;
} else if(CarInfo[vehicleid][tuning_5] < 1000){
CarInfo[vehicleid][tuning_5] = componentid;
} else if(CarInfo[vehicleid][tuning_6] < 1000){
CarInfo[vehicleid][tuning_6] = componentid;
} else if(CarInfo[vehicleid][tuning_7] < 1000){
CarInfo[vehicleid][tuning_7] = componentid;
} else if(CarInfo[vehicleid][tuning_8] < 1000){
CarInfo[vehicleid][tuning_8] = componentid;
} else if(CarInfo[vehicleid][tuning_9] < 1000){
CarInfo[vehicleid][tuning_9] = componentid;
} else if(CarInfo[vehicleid][tuning_10] < 1000){
CarInfo[vehicleid][tuning_10] = componentid;
} else if(CarInfo[vehicleid][tuning_11] < 1000){
CarInfo[vehicleid][tuning_1] = componentid;
} else if(CarInfo[vehicleid][tuning_12] < 1000){
CarInfo[vehicleid][tuning_12] = componentid;
} else if(CarInfo[vehicleid][tuning_13] < 1000){
CarInfo[vehicleid][tuning_13] = componentid;
}
Ich hoffe ihr wisst warum das nicht funktioniert oder habt eine Idee
(PS: In meinem Vehicles Ordner erstellen 1999 car Datein obwohl es nur 2 Fahrzeuge gibt ... Warum?)