Round out players
#3

pawn Код:
// Top of script
#define TeamAmount 10 // Replace this if you want more teams
#define MaxTeamPlayers 25 // Max players allowed on a team

PlayersOnTeam[TeamAmount];

// Anywhere in script
public OnPlayerSpawn(playerid)
{
  if(PlayersOnTeam[Team[playerid]] > MaxTeamPlayers) // Replace team with your variable for teams e.g. gTeam
  {
    SendClientMessage(playerid, color, "Team full, Assigning you to a different team"); // Replace color with a color of your choice
    Team[playerid] = random(MaxTeamPlayers);// Replace team with your variable for teams e.g. gTeam
    SetPlayerHealth(playerid, 0);
    return 1;
  }
  else
  {
    PlayersOnTeam[Team[playerid]]++;// Replace team with your variable for teams e.g. gTeam
  }
  return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
  PlayersOnTeam[Team[playerid]]--;// Replace team with your variable for teams e.g. gTeam
  return 1;
}
That should give you a rough idea of what you need to do
Reply


Messages In This Thread
Round out players - by StrickenKid - 13.04.2009, 22:26
Re: Round out players - by StrickenKid - 14.04.2009, 00:56
Re: Round out players - by ICECOLDKILLAK8 - 14.04.2009, 01:08
Re: Round out players - by Backwardsman97 - 14.04.2009, 01:12
Re: Round out players - by StrickenKid - 14.04.2009, 01:25
Re: Round out players - by Backwardsman97 - 14.04.2009, 02:18

Forum Jump:


Users browsing this thread: 1 Guest(s)