remove all unoccupied cars spawned with /v command.
#3

pawn Код:
stock GetVehicleDriver(vehicleid)
{
  for(new i; i<MAX_PLAYERS; i++)
  {
    if (IsPlayerInVehicle(i, vehicleid))
    {
      if(GetPlayerState(i) == 2)
      {
            return i;
      }
    }
  }
  return -1;
}
Using this stock

pawn Код:
CMD:v(...)
{
    for(new i = 0 ; i < MAX_VEHICLES; i++)
    {
           if(GetVehicleDriver( i ) == -1)
           {
                DestroyVehicle( i );
           }
    }
  return 1;
}
You can do the same to get passengers, I'm sure there's a stock for that
Reply


Messages In This Thread
remove all unoccupied cars spawned with /v command. - by RedJohn - 21.08.2013, 23:26
Re: remove all unoccupied cars spawned with /v command. - by RedJohn - 22.08.2013, 15:19
Re: remove all unoccupied cars spawned with /v command. - by RajatPawar - 22.08.2013, 15:23
Re: remove all unoccupied cars spawned with /v command. - by RedJohn - 24.08.2013, 00:35
Re: remove all unoccupied cars spawned with /v command. - by RajatPawar - 24.08.2013, 07:32

Forum Jump:


Users browsing this thread: 1 Guest(s)