how to check if all players in 1 team
#1

Solved
Reply
#2

Would it be so special that it would kill you to explain more FFS no one really wants to steal your code, honestly it's prob. not that awesome(No offense)

But anyways, are you wanting to switch half the players from TEAM_ZOMBIE to TEAM_HUMAN or something?
Reply
#3

pawn Код:
myFunc()
{
    new
        allZombie = 1;
    for (new i; i < MAX_PLAYERS; ++i)
    {
        if (!IsPlayerConnected(i)) continue;
        if (GetPlayerTeam(i) != TEAM_ZOMBIE) allZombie = 0, break;
    }

    if (allZombie)
    {
        // everyone is a zombie
    }
    else
    {
        // at least 1 non-zombie
    }
}
use foreach instead of the for loop I've used if you use foreach
Reply
#4

Solved
Reply
#5

ya

The message you have entered is too short. Please lengthen your message to at least 8 characters.
Reply
#6

Solved
Reply
#7

use a variable. put the variable of all of the teams to 1. then loop, and find which players have the variable you made set a 1.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)