01.01.2011, 13:04
I haven't figured out how to make all server vehicles respawn with SetTimer and function?
Can anyone here explain ?
Can anyone here explain ?
// Somewhere, like in a command
SetTimer( "RespawnVehicles", 5000, false ); // Change '5000' to make a different delay
// After main( )
forward RespawnVehicles( );
public RespawnVehicles( )
{
for( new i = 0; i < MAX_VEHICLES; i ++ )
{
SetVehicleToRespawn( i );
}
}
// Somewhere, like in a command
SetTimer( "RespawnVehicles", 5000, false ); // Change '5000' to make a different delay
// After main( )
forward RespawnVehicles( );
public RespawnVehicles( )
{
for( new i = 0; i < MAX_VEHICLES; i ++ )
{
if(!IsPlayerInAnyVehicle(i))
{
SetVehicleToRespawn( i );
}
}
}
// 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;
}