thanks for your help but I use infinite round (from a module of dias called InfinityGame) so I need a stock that is called in an if to detect when a team is dead and finish the round, that's how I use it but sometimes it doesn't work and bug the round.
PHP Code:
public Check_Gameplay()
{
if((Get_PlayerCount(1, 1) <= 0) && !pev_valid(g_TerroristBase)) // All terrorist are dead
{
Game_Ending(5.0, 0, CS_TEAM_CT)
return
}
else if((Get_PlayerCount(1, 2) <= 0) && !pev_valid(g_CTBase)) // All CT are dead
{
Game_Ending(5.0, 0, CS_TEAM_T)
return
}
}
stock Get_PlayerCount(Alive, Team)
// Alive: 0 - Dead | 1 - Alive | 2 - Both
// Team: 1 - T | 2 - CT
{
new Flag[4], Flag2[12]
new Players[32], PlayerNum
if(!Alive) formatex(Flag, sizeof(Flag), "%sb", Flag)
else if(Alive == 1) formatex(Flag, sizeof(Flag), "%sa", Flag)
if(Team == 1)
{
formatex(Flag, sizeof(Flag), "%se", Flag)
formatex(Flag2, sizeof(Flag2), "TERRORIST", Flag)
}
else if(Team == 2)
{
formatex(Flag, sizeof(Flag), "%se", Flag)
formatex(Flag2, sizeof(Flag2), "CT", Flag)
}
get_players(Players, PlayerNum, Flag, Flag2)
return PlayerNum
}
I found that stock in a code that is not mine