new TEAM_COP[MAX_PLAYERIS]; new TEAM_PRIS[MAX_PLAYERS];
//where you set teams
if ( team_count_A > team_count_B )
{
//set to team B
}
else if ( team_count_B > team_count_A )
{
//set to team A
}
else
{
//set them to the one they picked
}
Originally Posted by Donny
pawn Код:
|
Originally Posted by aspire5630
**BUMP
|
Originally Posted by aspire5630
yeh, what it will do
say.. 4 prisoners... it will make the next people who log on Cops Just to balance the teams |
Originally Posted by ┤ŞąiBЄЯҒПŋ├
Quote:
if team got more player or if team b got more if yes set the player to the other team or whatever u want to do then to check how much ppl are on the team ull need to make a loop which goes through ur maxplayers n check everyone if they are on team a or team b (u need 2 new variables in the loop one for team a and one for b) then if the player it just loops through is team a it sets variable a++; and if he is team b it sets variable b++; after that it should check what i explained above |
//top new team_count_A; new team_count_B; //OnPlayerRequestSpawn if ( team_count_A > team_count_B ) { //deny team A and set to team B } else if ( team_count_B > team_count_A ) { //deny team B and set to team A } else { //set them to the one they picked } //OnPlayerSpawn If(gTeam=TEAM_COP) { //add the value "1" to the variable new team_count_A; } else if(gTeam=TEAM_PRIS) { //add the value "1" to the variable new team_count_B; } //OnPlayerDisconnect If(gTeam=TEAM_COP) { //subtractthe value "1" to the variable new team_count_A; } else if(gTeam=TEAM_PRIS) { //subtract the value "1" to the variable new team_count_B; }
Originally Posted by [KG
Nikere ]
Код:
//top new team_count_A; new team_count_B; //OnPlayerRequestSpawn if ( team_count_A > team_count_B ) { //deny team A and set to team B } else if ( team_count_B > team_count_A ) { //deny team B and set to team A } else { //set them to the one they picked } //OnPlayerSpawn If(gTeam=TEAM_COP) { //add the value "1" to the variable new team_count_A; } else if(gTeam=TEAM_PRIS) { //add the value "1" to the variable new team_count_B; } //OnPlayerDisconnect If(gTeam=TEAM_COP) { //subtractthe value "1" to the variable new team_count_A; } else if(gTeam=TEAM_PRIS) { //subtract the value "1" to the variable new team_count_B; } |
//OntopOfScript
new team1count,team2count;
//OnPlayerREquestSpawn/Sumwhere in script
OnPlayerRequestSpawn(playerid)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(GetPlayerTeam(i) == GTEAM_ONE)
{
team1count++;
}
if(GetPlayerTeam(i) == GTEAM_TWO)
{
team2count++;
}
}
if(team1count > team2count)
{
SetPlayerTeam(playerid,2);
}
if(team2count > team1count)
{
SetPlayerTeam(playerid,1);
}
if(team2count == team1count)
{
//Set the Selected Team(however u want to do it.
}
}