01.01.2013, 12:06
Code:
public car_respawnFact(factionID)
{
new bool:unwanted[MAX_CAR];
for(new player=MIN_PLAYERID; player<MAX_PLAYERS_CURRENT+1; player++)
{
if(IsPlayerConnected(player) && IsPlayerInAnyVehicle(player))
{unwanted[GetPlayerVehicleID(player)]=true;}
}
for(new car=1; car<=totalcars; car++)
{if(CarInfo[car][cFaction] == factionID && unwanted[car]) car_respawn(car,false);}
return 1;
}
Code:
if(strcmp(subcmd,"faction",true)==0)
{
tmp = strtok(cmdtext,idx);
if(!strlen(tmp)) { return 1; }
new factId = strval(tmp);
if(factId<1 || factId>16) { return 1; }
new factname[LITTLE_STRING];
fact_name(factId, factname);
car_respawnFact(factId);
format(string,sizeof(string),"[Info] Respawn of the vehicles of the faction %s by %s.",factname,playername);
SendClientMessageToAll(COLOR_AOOC, string);
return 1;
}

