team members
#1

Im looking to see if it is possible to set a maximum user amount to SetPlayerTeam, and if there is a way to get the members that are in the team(integer). I want to use this to add a max to the round in my TDM server, and also so players can see who is in what team so they can join based on that.
Reply
#2

i dont think u can set the maximum team members for that function, all u need to do is create an array that holds every team members count, then when the max is reached u just disallow players from joining it

this array gets initialized to 0 (for all teams), then when somebody joins a certain team, it gets inceased by one, and when somebody leaves, it gets decreased, as simple as that
Reply
#3

here's an example but you cant set the maximum players... it sets atomatically btw its like auto balance hope this was te one u are seraching for... btw edit your team name to the one here, these teams are in my server , its a stock place it in the place you want.

pawn Код:
stock IsTeamFull(teamid)
{
    if(teamid == T_ENGLAND)
    {
        if(TeamMembers(teamid) > TeamMembers(T_RUSSIA) || TeamMembers(teamid) > TeamMembers(T_MEXICO) || TeamMembers(teamid) > TeamMembers(T_ISRAEL) || TeamMembers(teamid) > TeamMembers(T_JAPAN))
        {
            return 1;
        }
        else return 0;
    }
    if(teamid == T_RUSSIA)
    {
        if(TeamMembers(teamid) > TeamMembers(T_ENGLAND) || TeamMembers(teamid) > TeamMembers(T_MEXICO) || TeamMembers(teamid) > TeamMembers(T_ISRAEL) || TeamMembers(teamid) > TeamMembers(T_JAPAN))
        {
            return 1;
        }
        else return 0;
    }
    if(teamid == T_MEXICO)
    {
        if(TeamMembers(teamid) > TeamMembers(T_RUSSIA) || TeamMembers(teamid) > TeamMembers(T_ENGLAND) || TeamMembers(teamid) > TeamMembers(T_ISRAEL) || TeamMembers(teamid) > TeamMembers(T_JAPAN))
        {
            return 1;
        }
        else return 0;
    }
    if(teamid == T_ISRAEL)
    {
        if(TeamMembers(teamid) > TeamMembers(T_RUSSIA) || TeamMembers(teamid) > TeamMembers(T_MEXICO) || TeamMembers(teamid) > TeamMembers(T_ENGLAND) || TeamMembers(teamid) > TeamMembers(T_JAPAN))
        {
            return 1;
        }
        else return 0;
    }
    if(teamid == T_JAPAN)
    {
        if(TeamMembers(teamid) > TeamMembers(T_RUSSIA) || TeamMembers(teamid) > TeamMembers(T_MEXICO) || TeamMembers(teamid) > TeamMembers(T_ENGLAND) || TeamMembers(teamid) > TeamMembers(T_ISRAEL))
        {
            return 1;
        }
        else return 0;
    }
    return 0;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)