Hallo,
mein /respawncars Befehl funktioniert nicht. Die Autos werden nicht gelöscht und neu erstellt, sondern nur neu erstellt, habe dann also 2 von dennen -.-
if(strcmp(cmd,"/respawncars",true)==0)
{
for(new i=0;i<MAX_CARS;i++)
{
new bool:unwantedc[MAX_VEHICLES];
for(new player=0; player<GetMaxPlayers(); player++)
{
if(IsPlayerInAnyVehicle(player)) { unwantedc[GetPlayerVehicleID(player)]=true; }
}
if(pInfo[playerid][Leader] == 1)
{
if(FCInfo[i][Frakid] == 1)
{
if(!unwantedc[i]) RespawnFVehicle(i);
}
}
if(pInfo[playerid][Leader] == 2)
{
if(FCInfo[i][Frakid] == 2)
{
if(!unwantedc[i]) RespawnFVehicle(i);
}
}
if(pInfo[playerid][Leader] == 3)
{
if(FCInfo[i][Frakid] == 3)
{
if(!unwantedc[i]) RespawnFVehicle(i);
}
}
if(pInfo[playerid][Leader] == 4)
{
if(FCInfo[i][Frakid] == 4)
{
if(!unwantedc[i]) RespawnFVehicle(i);
}
}
if(pInfo[playerid][Leader] == 5)
{
if(FCInfo[i][Frakid] == 5)
{
if(!unwantedc[i]) RespawnFVehicle(i);
}
}
if(pInfo[playerid][Leader] == 6)
{
if(FCInfo[i][Frakid] == 6)
{
if(!unwantedc[i]) RespawnFVehicle(i);
}
}
if(pInfo[playerid][Leader] == 7)
{
if(FCInfo[i][Frakid] == 7)
{
if(!unwantedc[i]) RespawnFVehicle(i);
}
}
if(pInfo[playerid][Leader] == 8)
{
if(FCInfo[i][Frakid] == 8)
{
if(!unwantedc[i]) RespawnFVehicle(i);
}
}
if(pInfo[playerid][Leader] == 9)
{
if(FCInfo[i][Frakid] == 9)
{
if(!unwantedc[i]) RespawnFVehicle(i);
}
}
if(pInfo[playerid][Leader] == 10)
{
if(FCInfo[i][Frakid] == 10)
{
if(!unwantedc[i]) RespawnFVehicle(i);
}
}
if(pInfo[playerid][Leader] == 11)
{
if(FCInfo[i][Frakid] == 11)
{
if(!unwantedc[i]) RespawnFVehicle(i);
}
}
if(pInfo[playerid][Leader] == 12)
{
if(FCInfo[i][Frakid] == 12)
{
if(!unwantedc[i]) RespawnFVehicle(i);
}
}
if(pInfo[playerid][Leader] == 13)
{
if(FCInfo[i][Frakid] == 13)
{
if(!unwantedc[i]) RespawnFVehicle(i);
}
}
}
return 1;
}
stock RespawnFVehicle(vehicleid)
{
new Float:x,Float:y,Float:z,Float:a;
x = FCInfo[vehicleid][fcx];
y = FCInfo[vehicleid][fcy];
z = FCInfo[vehicleid][fcz];
a = FCInfo[vehicleid][fca];
DestroyVehicle(vehicleid);
CreateVehicle(FCInfo[vehicleid][fmodelid],x,y,z,a,FCInfo[vehicleid][fcc1],FCInfo[vehicleid][fcc2],-1);
AddFCarTuning(vehicleid);
}