15.02.2011, 20:02
@ the top:
Will make a callback for the repeating timer and will check if player is dead
Will start the timer to check if everyone is dead
Will make the server know if player is dead or not.
If everyone is dead at the whole server, it will put them at class selection!
UNTESTED.
pawn Код:
forward dead( );
new deada[ MAX_PLAYERS ];
pawn Код:
public OnGameModeInit( )
{
SetTimer( "dead", 5000, 1 );
return 1;
}
pawn Код:
public OnPlayerDeath( playerid )
{
deada[ playerid ] = 1;
return 1;
}
pawn Код:
public OnPlayerSpawn( playerid )
{
deada[ playerid ] = 0;
return 1;
}
pawn Код:
public dead( )
{
new count = 0;
for( new i = 0; i < MAX_PLAYERS; i++ )
{
if( deada[ i ] == 0 )
{
count++;
}
}
if( count == 0 )
{
for( new a = 0; a < MAX_PLAYERS; a++ )
{
if( IsPlayerConnected( a ) )
{
ForceClassSelection( a );
SetPlayerHealth( a, 0.0 );
}
}
}
return 1;
}
UNTESTED.