help please
#1

How to make respawn when all players dead?- whe all die they all will go to the class selection

I want that if you die you will only goto the class selection when everyone is dead how can i do that?

please help

[]thanx for helper[]
Reply
#2

@ the top:
pawn Код:
forward dead( );
new deada[ MAX_PLAYERS ];
Will make a callback for the repeating timer and will check if player is dead

pawn Код:
public OnGameModeInit( )
{
    SetTimer( "dead", 5000, 1 );
    return 1;
}
Will start the timer to check if everyone is dead

pawn Код:
public OnPlayerDeath( playerid )
{
    deada[ playerid ] = 1;
    return 1;
}
pawn Код:
public OnPlayerSpawn( playerid )
{
    deada[ playerid ] = 0;
    return 1;
}
Will make the server know if player is dead or not.


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;
}
If everyone is dead at the whole server, it will put them at class selection!
UNTESTED.
Reply
#3

thanx bro no errors but i sure this will worke lot thanx to you
Reply
#4

amm ineed help again
can u do a when all players is this team: if (PlayerTeam[playerid] == 1) /TEAM_ZOMBIE
all will go to the class section

please
Reply
#5

some 1 ?
Reply
#6

Don't understand what u mean.
Reply
#7

i mean: if all will be a zombie team : Zombie - TEAM_ZOMBIE all go to the class selection
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)