[ReAPI] End round if X condition happen

Сообщения
35
Реакции
9
Hello, I got a Lifes system, I wanna do if X team has 0 lives (between all players) forces round to end and give a Win to the opposite team.
What should I do?

I got
PHP:
new g_iLives[ 33 ];
thats where lives are stored.

also

PHP:
public CSGameRules_DeathNotice( victim, attacker, shouldgib )
{
    if(!g_bRoundEnding)
        set_task( 1.5, "task_Spawn", victim );
}

public Round_Started()
{
    g_bRoundEnding = false

    for( new id = 1; id <= g_iMaxPlayers; id++ )
    {
        if( is_user_connected( id ) )
            g_iLives[ id ] = 2;
    }   

   
}

public End_round()
{
    g_bRoundEnding = true
}

public task_Spawn( id )
{
    if( g_iLives[ id ] > 0 )
    {
        ExecuteHamB( Ham_CS_RoundRespawn, id );

        g_iLives[ id ]--;
    }
    else
        ChatColor( id, "!g[Test]!y You have 0 lifes, you wont respawn anymore" );
}
 
Сообщения
2,751
Реакции
3,016
Помог
61 раз(а)
Сообщения
35
Реакции
9
Okay, I understand, but can you give me a more practice example? Like, do I need to block round ending first then make use of get_players and check if CT team has 0 lifes then do a RoundEnd function or something like that?
 

Garey

ninjaCow
Сообщения
422
Реакции
1,056
Помог
10 раз(а)
I think you can just dont revive players if he dont have more life's, so if all players of team dead - opposite team will win ? (i think 0 life's for all players = all dead xD) ?
 
Сообщения
35
Реакции
9
Thats already done, thing is, if there is a 1v1 happening, round will end no matter what, and if there is a 1v2 happening, and those 2 players die at the same time round will end, what I need its force round to end if enemy team has 0 lives between all players

What do I have to do in order to, Block round end and force Round end only IF enemy team has 0 lifes between all players
10 Июн 2018
Any help :(?
 
Последнее редактирование:

Пользователи, просматривающие эту тему

Сейчас на форуме нет ни одного пользователя.
Сверху Снизу