Guten Abend ,
Ich habe das Problem das alle meine Fahrzeuge wenn man sie zu schrott fährt einfach Respawnen wenn man drin sitzt. Wenn man jedoch aussteigt explodieren sie ..
Ich habe zwar öfter gehört das das ein GF Bug ist aber ich weiß nicht wie ich den weg bekomme, ich hoffe ihr könnt mir helfen
hier paar Code schnipsel:
Function OnVehicleDeath(vehicleid)
{
for(new playerid = 0; playerid < MAX_PLAYERS; playerid++)
{
for(new x = 0; x < MaxVeh; x++)
{
if(IsPlayerConnected(playerid) && Dtc_PlayerHaveCar[playerid][x])
{
if (vehicleid == PlayerCar[playerid][x][CarId])
{
DestroyVehicle(PlayerCar[playerid][x][CarId]);
PlayerCarSpawn(playerid,x);
}
}
}
}
return 1;
}
Function OnVehicleSpawn(vehicleid)
{
Gas[vehicleid] = GetGasMax(vehicleid);
for(new playerid = 0; playerid < MAX_PLAYERS; playerid++)
{
for(new x = 0; x < MaxVeh; x++)
{
if(IsPlayerConnected(playerid) && Dtc_PlayerHaveCar[playerid][x])
{
if (vehicleid == PlayerCar[playerid][x][CarId])
{
SetTimerEx("CarTuning",700,0,"ii",playerid,x);
}
}
}
}
DestroyObject(sirene[vehicleid]);
DestroyObject(sirene1[vehicleid]);
DestroyObject(sirene2[vehicleid]);
DestroyObject(sirene3[vehicleid]);
UCL[vehicleid] = 0;//ist wegen der "if" Anfrage beim /command
return 1;
}
Function PlayerCarSpawn(playerid,Slot)
{
if(IsPlayerConnected(playerid))
{
if(Dtc_PlayerHaveCar[playerid][Slot])
{
PlayerCar[playerid][Slot][CarId] = CreateVehicle(PlayerCar[playerid][Slot][CarModel],PlayerCar[playerid][Slot][CarPos_x],PlayerCar[playerid][Slot][CarPos_y],PlayerCar[playerid][Slot][CarPos_z],PlayerCar[playerid][Slot][CarRotate],PlayerCar[playerid][Slot][CarC1],PlayerCar[playerid][Slot][CarC2], 60000);/*vehicle spawn*/
ChangeVehicleColor(PlayerCar[playerid][Slot][CarId],PlayerCar[playerid][Slot][CarC1],PlayerCar[playerid][Slot][CarC2]);
if(PlayerCar[playerid][Slot][CarPJ] >= 0) {ChangeVehiclePaintjob(PlayerCar[playerid][Slot][CarId],PlayerCar[playerid][Slot][CarPJ]);}
if(PlayerCar[playerid][Slot][CarNitro] != 0) {AddVehicleComponent(PlayerCar[playerid][Slot][CarId],PlayerCar[playerid][Slot][CarNitro]);}
if(PlayerCar[playerid][Slot][CarHyd] != 0) {AddVehicleComponent(PlayerCar[playerid][Slot][CarId],PlayerCar[playerid][Slot][CarHyd]);}
if(PlayerCar[playerid][Slot][CarWheel] != 0) {AddVehicleComponent(PlayerCar[playerid][Slot][CarId],PlayerCar[playerid][Slot][CarWheel]);}
if(PlayerCar[playerid][Slot][CarAusp] != 0) {AddVehicleComponent(PlayerCar[playerid][Slot][CarId],PlayerCar[playerid][Slot][CarAusp]);}
if(PlayerCar[playerid][Slot][CarSideL] != 0) {AddVehicleComponent(PlayerCar[playerid][Slot][CarId],PlayerCar[playerid][Slot][CarSideL]);}
if(PlayerCar[playerid][Slot][CarSideR] != 0) {AddVehicleComponent(PlayerCar[playerid][Slot][CarId],PlayerCar[playerid][Slot][CarSideR]);}
if(PlayerCar[playerid][Slot][CarFB] != 0) {AddVehicleComponent(PlayerCar[playerid][Slot][CarId],PlayerCar[playerid][Slot][CarFB]);}
if(PlayerCar[playerid][Slot][CarRB] != 0) {AddVehicleComponent(PlayerCar[playerid][Slot][CarId],PlayerCar[playerid][Slot][CarRB]);}
if(PlayerCar[playerid][Slot][CarSpoiler] != 0) {AddVehicleComponent(PlayerCar[playerid][Slot][CarId],PlayerCar[playerid][Slot][CarSpoiler]);}
if(PlayerCar[playerid][Slot][CarRoof] != 0) {AddVehicleComponent(PlayerCar[playerid][Slot][CarId],PlayerCar[playerid][Slot][CarRoof]);}
if(PlayerCar[playerid][Slot][CarHood] != 0) {AddVehicleComponent(PlayerCar[playerid][Slot][CarId],PlayerCar[playerid][Slot][CarHood]);}
if(PlayerCar[playerid][Slot][CarVents] != 0) {AddVehicleComponent(PlayerCar[playerid][Slot][CarId],PlayerCar[playerid][Slot][CarVents]);}
if(PlayerCar[playerid][Slot][CarLamps] != 0) {AddVehicleComponent(PlayerCar[playerid][Slot][CarId],PlayerCar[playerid][Slot][CarLamps]);}
if(Dtc_LockOnSpawn)
{
Dtc_Carlock[PlayerCar[playerid][Slot][CarId]] = 1;
Dtc_LockCar(PlayerCar[playerid][Slot][CarId]);
}
new strings[15];
new name[MAX_PLAYER_NAME], str[128];
GetPlayerName(playerid, name, sizeof name);
format(str, sizeof str, "/Autos/%s%d.dtcar", name,Dtc_PlayerKey[playerid]);
format(strings, sizeof(strings), "%s", dini_Get(str, "Plate"));
SetVehicleNumberPlate(PlayerCar[playerid][Slot][CarId], strings);
SetVehicleToRespawn(PlayerCar[playerid][Slot][CarId]);
for(new x = 0; x < MaxVeh; x++)
{
PlayerCar[playerid][x][Plate] = strings;
}
}
}
}