team balance
#7

Quote:
Originally Posted by Skribblez
Посмотреть сообщение
I didn't know what you want until you replied on the other post.

Try this:
pawn Код:
#define MAX_TEAM_COUNT 5
// maximum members a team can have
#define MAX_TEAMS 10
// you can change this to the amount of teams you have

// declare an enumeration for each team having a variable for their member count.
enum TeamInfo
{
    TeamMembers,
};
// create variables for a player
new Team[MAX_TEAMS][TeamInfo];
new ChosenTeam[MAX_PLAYERS];

// when a player connects, their default team is set to -1 which is non-existent.
public OnPlayerConnect(playerid)
{
    ChosenTeam[playerid] = -1;
    return 1;
}

// after choosing their team, however you do it and is about to spawn it will check the number of members
// that the team already has.
public OnPlayerSpawn(playerid)
{
    if(ChosenTeam[playerid] != -1)
    {
        if(TeamMembers[ChosenTeam[playerid]] < MAX_TEAM_COUNT) // checks if the team members' count is less than the max(5)
        {
            SpawnPlayer(playerid); // spawns the player
            SetPlayerTeam(playerid, ChosenTeam[playerid]); // setting the players team to what they have selected.
            Team[ChosenTeam[playerid]][TeamMembers]++; // this will add 1 to the current team member count.
        }
        else SendClientMessage(playerid, -1, "The team you have chosen is already full.");
    }
    return 1;
}
still cant work. nvm
Reply


Messages In This Thread
team balance - by oscar7610 - 17.04.2012, 20:11
Re: team balance - by ViniBorn - 17.04.2012, 20:13
Re: team balance - by oscar7610 - 17.04.2012, 20:17
Re: team balance - by Skribblez - 17.04.2012, 20:19
Re: team balance - by oscar7610 - 17.04.2012, 20:23
Re: team balance - by Skribblez - 17.04.2012, 20:31
Re: team balance - by oscar7610 - 17.04.2012, 20:37

Forum Jump:


Users browsing this thread: 1 Guest(s)