[HELP] Team balancer - Im half way there
#1

for OnplayerRequestSpawn ive got

Код:
	for(new i = 0; i < MAX_PLAYERS; i++)
	{
		if(IsPlayerConnected(i))
		{
			if (WestTeam[i] < EastTeam[i])
			{
			}
		}
	}
Now, i dont know wat to do, i want to make it so that If West team has more players than East team....(Btw, its defined that if a player enters server and chooses a west team skin, then WestTeam =1 and EastTeam= 0.)

These are errors i get when i compile, they are all on line 'if (WestTeam[i] < EastTeam[i])'

Код:
C:\Documents and Settings\Darren(cool person)\Desktop\SGGW.pwn(889) : error 017: undefined symbol "EastTeam"
C:\Documents and Settings\Darren(cool person)\Desktop\SGGW.pwn(889) : warning 215: expression has no effect
C:\Documents and Settings\Darren(cool person)\Desktop\SGGW.pwn(889) : error 001: expected token: ";", but found "]"
C:\Documents and Settings\Darren(cool person)\Desktop\SGGW.pwn(889) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Darren(cool person)\Desktop\SGGW.pwn(889) : fatal error 107: too many error messages on one line
Reply
#2

I don't see why you need a loop for this.. Actually I don't see the issue.
Reply
#3

define EastTeam

new EastTeam[MAX_PLAYERS];
Reply
#4

Quote:
Originally Posted by Fukara_GM
define EastTeam

new EastTeam[MAX_PLAYERS];
Why do you want to define it and then make a "new ...."decleration? it's useless

@topic I don't know how your code would become a "Team balancer" but I would make something like this:
set a variable "gTeam[playerid]" for your Teams (WestTeam = 1 and EastTeam = 0) and define WestSpawn and EastSpawn onto your mode. Those variables can be raised the same way you'll define the gTeam.

Код:
public OnPlayerRequestSpawn(playerid)
{
	if(gTeam[playerid] == 1 && WestSpawn > EastSpawn || gTeam[playerid] == 0 && EastSpawn > WestSpawn)
	{
	  GameTextForPlayer(playerid, "Please chose another Team!", 3500, 5);
	  return 0;
	}
	return 1;
}
This is the method I would choose.

Good bye
D3nnis
Reply
#5

wat is Gteam
Reply
#6

Quote:
Originally Posted by Mowgli
wat is Gteam
It's just a variable?
On top of your Script "new gTeam[MAX_PLAYERS]" you can name it as you like.. "PlayerTeam", "pTeam" or "gTeam"(my case)
or what do you mean?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)