SA-MP Forums Archive
Team balance - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Team balance (/showthread.php?tid=217367)



Team balance - bartje01 - 27.01.2011

Hey guys. How to use teambalance with gTeam?

I /searched already.
Can't find anything that can help me

/emberrased.


Re: Team balance - bartje01 - 27.01.2011

Anyone?

EDIT:

Ow shit. I just bumped this to fast. I thought there was like a day passed again.
Sorry guys. I'm not sure where my mind is lately


Re: Team balance - Larsey123IsMe - 27.01.2011

pawn Код:
new TeamPlayers[ <Amount of teams here> ];

public OnPlayerRequestSpawn(playerid)
{
  for(new teams; teams < [Team Amount]; teams++)
  {
    if(teams == GetPlayerTeam(playerid)) continue; //Or gTeam[playerid], or w/e you use.
    if(TeamPlayers[Player Team Variable] > TeamPlayers[teams] + 3)
    {
      SendClientMessage(playerid, COLOR_RED, "You can't join this team as it would unbalance the game!");
      return 0;
    }
  }
}
//By Hiddos



Re: Team balance - bartje01 - 28.01.2011

pawn Код:
public OnPlayerRequestSpawn(playerid)
{
  for(new teams; teams < [2]; teams++)
  {
    if(teams == GetPlayerTeam(playerid)) continue;
    if(TeamPlayers[gTeam] > TeamPlayers[teams] + 3)
    {
      SendClientMessage(playerid, COLOR_RED, "You can't join this team as it would unbalance the game!");
      return 0;
    }
  }
}
error
pawn Код:
C:\Users\Michael\Desktop\Samp scvripting\gamemodes\terrorist.pwn(381) : error 029: invalid expression, assumed zero
C:\Users\Michael\Desktop\Samp scvripting\gamemodes\terrorist.pwn(381) : error 029: invalid expression, assumed zero
C:\Users\Michael\Desktop\Samp scvripting\gamemodes\terrorist.pwn(381) : warning 215: expression has no effect
C:\Users\Michael\Desktop\Samp scvripting\gamemodes\terrorist.pwn(381) : error 017: undefined symbol "teams"
C:\Users\Michael\Desktop\Samp scvripting\gamemodes\terrorist.pwn(381) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


4 Errors.



Re: Team balance - Steven Paul - 28.01.2011

show us your line number 31


Re: Team balance - bartje01 - 28.01.2011

pawn Код:
for(new teams; teams < [2]; teams++)



Re: Team balance - Steven Paul - 28.01.2011

use this tested


At the top add

Код:
new TeamPlayers[ <Amount of teams here> ];
And then replace this


pawn Код:
public OnPlayerRequestSpawn(playerid)
{
  for(new teams; teams < [Team Amount]; teams++)
  {
    if(teams == GetPlayerTeam(playerid)) continue; //Or gTeam[playerid], or w/e you use.
    if(TeamPlayers[Player Team Variable] > TeamPlayers[teams] + 3)
    {
      SendClientMessage(playerid, COLOR_RED, "You can't join this team as it would unbalance the game!");
      return 0;
    }
  }
}



Re: Team balance - bartje01 - 28.01.2011

Quote:
Originally Posted by Steven Paul
Посмотреть сообщение
use this tested


At the top add

Код:
new TeamPlayers[ <Amount of teams here> ];
And then replace this


pawn Код:
public OnPlayerRequestSpawn(playerid)
{
  for(new teams; teams < [Team Amount]; teams++)
  {
    if(teams == GetPlayerTeam(playerid)) continue; //Or gTeam[playerid], or w/e you use.
    if(TeamPlayers[Player Team Variable] > TeamPlayers[teams] + 3)
    {
      SendClientMessage(playerid, COLOR_RED, "You can't join this team as it would unbalance the game!");
      return 0;
    }
  }
}
Already have that. STill same errors.

Isn't there another way to balance them?


Re: Team balance - Steven Paul - 28.01.2011

what error does it gave


Re: Team balance - bartje01 - 28.01.2011

pawn Код:
C:\Users\Michael\Desktop\Samp scvripting\gamemodes\terrorist.pwn(389) : error 029: invalid expression, assumed zero
C:\Users\Michael\Desktop\Samp scvripting\gamemodes\terrorist.pwn(389) : error 029: invalid expression, assumed zero
C:\Users\Michael\Desktop\Samp scvripting\gamemodes\terrorist.pwn(389) : warning 215: expression has no effect
C:\Users\Michael\Desktop\Samp scvripting\gamemodes\terrorist.pwn(389) : error 017: undefined symbol "teams"
C:\Users\Michael\Desktop\Samp scvripting\gamemodes\terrorist.pwn(389) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


4 Errors.