get ALL players team ... is that posible ?
#1

is there any way to check if all the players (the online players ofcours) are in the same team
i mad this but I'm petty sure that's not correct
so all the ideas for this are welcome
Код:
    for(new I = 0; I < MAX_PLAYERS; I++) 
    {
           if GetPlayerTeam(i) == 1
           {  
                   new Winner = random(i);
                   SetPlayerTeam(Winner, 2);
                   SetPlayerHealth(Winner, 0);
            }
    }
Reply
#2

Look i created a function:

pawn Код:
stock GetPlayersFromTeam(TeamID)
{
    for(new I = 0; I < MAX_PLAYERS; I++)
    {
        if(!IsPlayerConnected(I)) continue;
        new
            Count = 0;
        if(GetPlayerTeam(I) == TeamID)
        {
            Count++;
        }
    }
    return Count;
}
Reply
#3

what this fuction do ?
Reply
#4

Example:

printf("In Red TM players:%i",GetPlayersFromTeam(1));

And will count all players in red team
Reply
#5

thanks this will be helpful
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)