Hallöchen,
ich habe ein Problem,
und das befindet sich hier: Wenn ein Fahrzeug zerstört wird soll es neu spawnen, aber es spawnen immer zwei. ich habe bei onvehiclespawn die lade datein ausgeklammert, jetzt spawnt nur noch ein auto, aber dafür werden die tuningteile und farben nicht geladen.
das SetVehicleToRespawn(vehicleid); kann ich auch nicht rausnehmen, dann spawnt das fahrzeug gar nicht mehr nachdem es zerstört wurde...
public OnVehicleDeath(vehicleid, killerid)
{
new string[32], playername[MAX_PLAYER_NAME];
GetPlayerName(killerid, playername, sizeof(playername));
format(string, sizeof(string), "Kofferraum/%s.ini", playername);
new File: hFile = fopen(string, io_write);
if(hFile)
{
fclose(hFile);
fremove(string);
}
Destroyed[vehicleid] = true;
new file[256], name[24];
GetPlayerName(killerid, name, 24);
format(file,sizeof(file),"Cars/%s.ini",name);
if(dini_Exists(file))
{
dini_IntSet(file, "Model", GetVehicleModel(Vehicle[killerid]));
dini_IntSet(file, "Price", VehicleInfo[killerid][Price]);
dini_FloatSet(file, "X", VehicleInfo[killerid][CarX]);
dini_FloatSet(file, "Y", VehicleInfo[killerid][CarY]);
dini_FloatSet(file, "Z", VehicleInfo[killerid][CarZ]);
dini_FloatSet(file, "Rot", VehicleInfo[killerid][CarRot]);
dini_IntSet(file, "Locked", VehicleInfo[killerid][Locked]);
dini_Set(file, "Plate", VehPlate[Vehicle[killerid]]);
dini_IntSet(file, "mod1", VehicleInfo[killerid][mod1]);
dini_IntSet(file, "mod2", VehicleInfo[killerid][mod2]);
dini_IntSet(file, "mod3", VehicleInfo[killerid][mod3]);
dini_IntSet(file, "mod4", VehicleInfo[killerid][mod4]);
dini_IntSet(file, "mod5", VehicleInfo[killerid][mod5]);
dini_IntSet(file, "mod6", VehicleInfo[killerid][mod6]);
dini_IntSet(file, "mod7", VehicleInfo[killerid][mod7]);
dini_IntSet(file, "mod8", VehicleInfo[killerid][mod8]);
dini_IntSet(file, "mod9", VehicleInfo[killerid][mod9]);
dini_IntSet(file, "mod10", VehicleInfo[killerid][mod10]);
dini_IntSet(file, "mod11", VehicleInfo[killerid][mod11]);
dini_IntSet(file, "mod12", VehicleInfo[killerid][mod12]);
dini_IntSet(file, "mod13", VehicleInfo[killerid][mod13]);
dini_IntSet(file, "mod14", VehicleInfo[killerid][mod14]);
dini_IntSet(file, "mod15", VehicleInfo[killerid][mod15]);
dini_IntSet(file, "mod16", VehicleInfo[killerid][mod16]);
dini_IntSet(file, "mod17", VehicleInfo[killerid][mod17]);
dini_IntSet(file, "paintjob", VehicleInfo[killerid][paintjob]);
dini_IntSet(file, "color1", VehicleInfo[killerid][colora]);
dini_IntSet(file, "color2", VehicleInfo[killerid][colorb]);
}
SetVehicleToRespawn(vehicleid);
return 1;
}
So hier das public onvehiclespawn:
public OnVehicleSpawn(vehicleid)
{
/*if(Destroyed[vehicleid] == true)
{
new file[256], name[MAX_PLAYER_NAME];
GetPlayerName(OwnerID[vehicleid], name, sizeof(name));
format(file,sizeof(file),"Cars/%s.ini",name);
if(dini_Exists(file))
{
VehicleInfo[OwnerID[vehicleid]][Model] = dini_Int(file, "Model");
VehicleInfo[OwnerID[vehicleid]][Price] = dini_Int(file, "Price");
VehicleInfo[OwnerID[vehicleid]][CarX] = dini_Float(file, "X");
VehicleInfo[OwnerID[vehicleid]][CarY] = dini_Float(file, "Y");
VehicleInfo[OwnerID[vehicleid]][CarZ] = dini_Float(file, "Z");
VehicleInfo[OwnerID[vehicleid]][CarRot] = dini_Float(file, "Rot");
VehicleInfo[OwnerID[vehicleid]][Locked] = dini_Int(file, "Locked");
VehicleInfo[OwnerID[vehicleid]][mod1] = dini_Int(file, "mod1");
VehicleInfo[OwnerID[vehicleid]][mod2] = dini_Int(file, "mod2");
VehicleInfo[OwnerID[vehicleid]][mod3] = dini_Int(file, "mod3");
VehicleInfo[OwnerID[vehicleid]][mod4] = dini_Int(file, "mod4");
VehicleInfo[OwnerID[vehicleid]][mod5] = dini_Int(file, "mod5");
VehicleInfo[OwnerID[vehicleid]][mod6] = dini_Int(file, "mod6");
VehicleInfo[OwnerID[vehicleid]][mod7] = dini_Int(file, "mod7");
VehicleInfo[OwnerID[vehicleid]][mod8] = dini_Int(file, "mod8");
VehicleInfo[OwnerID[vehicleid]][mod9] = dini_Int(file, "mod9");
VehicleInfo[OwnerID[vehicleid]][mod10] = dini_Int(file, "mod10");
VehicleInfo[OwnerID[vehicleid]][mod11] = dini_Int(file, "mod11");
VehicleInfo[OwnerID[vehicleid]][mod12] = dini_Int(file, "mod12");
VehicleInfo[OwnerID[vehicleid]][mod13] = dini_Int(file, "mod13");
VehicleInfo[OwnerID[vehicleid]][mod14] = dini_Int(file, "mod14");
VehicleInfo[OwnerID[vehicleid]][mod15] = dini_Int(file, "mod15");
VehicleInfo[OwnerID[vehicleid]][mod16] = dini_Int(file, "mod16");
VehicleInfo[OwnerID[vehicleid]][mod17] = dini_Int(file, "mod17");
VehicleInfo[OwnerID[vehicleid]][paintjob] = dini_Int(file, "paintjob");
VehicleInfo[OwnerID[vehicleid]][colora] = dini_Int(file, "color1");
VehicleInfo[OwnerID[vehicleid]][colorb] = dini_Int(file, "color2");
Vehicle[OwnerID[vehicleid]] = CreateVehicle(VehicleInfo[OwnerID[vehicleid]][Model], VehicleInfo[OwnerID[vehicleid]][CarX], VehicleInfo[OwnerID[vehicleid]][CarY], VehicleInfo[OwnerID[vehicleid]][CarZ], VehicleInfo[OwnerID[vehicleid]][CarRot], -1, -1, 3600000);
if(VehicleInfo[OwnerID[vehicleid]][mod1]!=0) { AddVehicleComponent(Vehicle[OwnerID[vehicleid]],VehicleInfo[OwnerID[vehicleid]][mod1]); }
if(VehicleInfo[OwnerID[vehicleid]][mod2]!=0) { AddVehicleComponent(Vehicle[OwnerID[vehicleid]],VehicleInfo[OwnerID[vehicleid]][mod2]); }
if(VehicleInfo[OwnerID[vehicleid]][mod3]!=0) { AddVehicleComponent(Vehicle[OwnerID[vehicleid]],VehicleInfo[OwnerID[vehicleid]][mod3]); }
if(VehicleInfo[OwnerID[vehicleid]][mod4]!=0) { AddVehicleComponent(Vehicle[OwnerID[vehicleid]],VehicleInfo[OwnerID[vehicleid]][mod4]); }
if(VehicleInfo[OwnerID[vehicleid]][mod5]!=0) { AddVehicleComponent(Vehicle[OwnerID[vehicleid]],VehicleInfo[OwnerID[vehicleid]][mod5]); }
if(VehicleInfo[OwnerID[vehicleid]][mod6]!=0) { AddVehicleComponent(Vehicle[OwnerID[vehicleid]],VehicleInfo[OwnerID[vehicleid]][mod6]); }
if(VehicleInfo[OwnerID[vehicleid]][mod7]!=0) { AddVehicleComponent(Vehicle[OwnerID[vehicleid]],VehicleInfo[OwnerID[vehicleid]][mod7]); }
if(VehicleInfo[OwnerID[vehicleid]][mod8]!=0) { AddVehicleComponent(Vehicle[OwnerID[vehicleid]],VehicleInfo[OwnerID[vehicleid]][mod8]); }
if(VehicleInfo[OwnerID[vehicleid]][mod9]!=0) { AddVehicleComponent(Vehicle[OwnerID[vehicleid]],VehicleInfo[OwnerID[vehicleid]][mod9]); }
if(VehicleInfo[OwnerID[vehicleid]][mod10]!=0) { AddVehicleComponent(Vehicle[OwnerID[vehicleid]],VehicleInfo[OwnerID[vehicleid]][mod10]); }
if(VehicleInfo[OwnerID[vehicleid]][mod11]!=0) { AddVehicleComponent(Vehicle[OwnerID[vehicleid]],VehicleInfo[OwnerID[vehicleid]][mod11]); }
if(VehicleInfo[OwnerID[vehicleid]][mod12]!=0) { AddVehicleComponent(Vehicle[OwnerID[vehicleid]],VehicleInfo[OwnerID[vehicleid]][mod12]); }
if(VehicleInfo[OwnerID[vehicleid]][mod13]!=0) { AddVehicleComponent(Vehicle[OwnerID[vehicleid]],VehicleInfo[OwnerID[vehicleid]][mod13]); }
if(VehicleInfo[OwnerID[vehicleid]][mod14]!=0) { AddVehicleComponent(Vehicle[OwnerID[vehicleid]],VehicleInfo[OwnerID[vehicleid]][mod14]); }
if(VehicleInfo[OwnerID[vehicleid]][mod15]!=0) { AddVehicleComponent(Vehicle[OwnerID[vehicleid]],VehicleInfo[OwnerID[vehicleid]][mod15]); }
if(VehicleInfo[OwnerID[vehicleid]][mod16]!=0) { AddVehicleComponent(Vehicle[OwnerID[vehicleid]],VehicleInfo[OwnerID[vehicleid]][mod16]); }
if(VehicleInfo[OwnerID[vehicleid]][mod17]!=0) { AddVehicleComponent(Vehicle[OwnerID[vehicleid]],VehicleInfo[OwnerID[vehicleid]][mod17]); }
if(VehicleInfo[OwnerID[vehicleid]][colora]!=0 || VehicleInfo[OwnerID[vehicleid]][colorb]!=0)
{
ChangeVehicleColor(Vehicle[OwnerID[vehicleid]],VehicleInfo[OwnerID[vehicleid]][colora],VehicleInfo[OwnerID[vehicleid]][colorb]);
}
if(VehicleInfo[OwnerID[vehicleid]][paintjob]!=0)
{
ChangeVehiclePaintjob(Vehicle[OwnerID[vehicleid]],VehicleInfo[OwnerID[vehicleid]][paintjob]);
}
new tmp[256]; tmp = dini_Get(file, "Plate");
gPlayerHasCar[OwnerID[vehicleid]] = 1;
VehOwned[Vehicle[OwnerID[vehicleid]]] = 1;
SetVehicleParamsForPlayer(Vehicle[OwnerID[vehicleid]], OwnerID[vehicleid], 0, VehicleInfo[OwnerID[vehicleid]][Locked]);
gVehLocked[Vehicle[OwnerID[vehicleid]]] = VehicleInfo[OwnerID[vehicleid]][Locked];
SetVehicleNumberPlate(Vehicle[OwnerID[vehicleid]], tmp);
VehPlate[Vehicle[OwnerID[vehicleid]]] = tmp;
*/
Destroyed[vehicleid] = false;
//}
//}
return 1;
}
Wäre sehr nett wenn mir jmd schnellstmöglichst helfen könnte
MFG
Marco