Vehicle auto respawn with SetTimer?
#8

blackwave, that code will not work, the following is what you are looking for (still untested)
pawn Код:
// Somewhere, like in a command
SetTimer( "RespawnVehicles", 5000, false ); // Change '5000' to make a different delay

// After main( )
forward RespawnVehicles( );
public RespawnVehicles( )
{
   new vehicles[ MAX_VEHICLES ];
   for( new i = 0; i < MAX_PLAYERS; i ++ )
   {
      if( IsPlayerInAnyVehicle( i ) )
      {
         vehicles[ GetPlayerVehicleID( i ) ] = 1;
      }
   }

   for( new v = 0; v < MAX_VEHICLES; v ++ )
   {
      if( vehicles[ v ] == 1 ) continue;
      SetVehicleToRespawn( v );
   }
   return 1;
}
I can't think of a better way at approaching this at the time.
Reply


Messages In This Thread
Vehicle auto respawn with SetTimer? - by Hudgens - 01.01.2011, 13:04
Re: Vehicle auto respawn with SetTimer? - by Grim_ - 01.01.2011, 13:08
Re: Vehicle auto respawn with SetTimer? - by Hudgens - 01.01.2011, 13:47
Re: Vehicle auto respawn with SetTimer? - by Hudgens - 01.01.2011, 15:53
Re: Vehicle auto respawn with SetTimer? - by Grim_ - 01.01.2011, 16:09
Re: Vehicle auto respawn with SetTimer? - by Hudgens - 01.01.2011, 17:04
Re: Vehicle auto respawn with SetTimer? - by blackwave - 01.01.2011, 18:08
Re: Vehicle auto respawn with SetTimer? - by Grim_ - 01.01.2011, 18:14

Forum Jump:


Users browsing this thread: 1 Guest(s)