Teams Balancer
#1

I have searched this a lot, i have testes more than four balance systems and didnґt work on my server.
Im looking for balancer team (If player will choose Team1 and this team have more players than the other, GameTextForPlayer shows and tell to him that this team is full, then he need choose the other one to spawn)
Im using gTeam and two teams (Policias and Terroristas)
Reply
#2

Код:
        new Balance, gTeam[MAX_PLAYERS];

        if(Balance == 0 || Balance == 1)
	{
		Balance = 2;
		gTeam[playerid] = 0;
	}
	else if(Balance == 2)
	{
		Balance = 1;
		gTeam[playerid] = 1;
	}
debug?

Код:
public OnGameModeInit()
{
	SetTimer("TestBalance", 500, true);
	return 1;
}

forward TestBalance();
public TestBalance()
{
	if(Balance == 0 || Balance == 1)
	{
		Balance = 2;
		gTeam[0] = 0;
		
		print("Team 0");
	}
	else if(Balance == 2)
	{
		Balance = 1;
		gTeam[0] = 1;
		
		print("Team 1");
	}
	return 1;
}
Reply
#3

Quote:
Originally Posted by F1N4L
Посмотреть сообщение
Код:
        new Balance, gTeam[MAX_PLAYERS];

        if(Balance == 0 || Balance == 1)
	{
		Balance = 2;
		gTeam[playerid] = 0;
	}
	else if(Balance == 2)
	{
		Balance = 1;
		gTeam[playerid] = 1;
	}
debug?

Код:
public OnGameModeInit()
{
	SetTimer("TestBalance", 500, true);
	return 1;
}

forward TestBalance();
public TestBalance()
{
	if(Balance == 0 || Balance == 1)
	{
		Balance = 2;
		gTeam[0] = 0;
		
		print("Team 0");
	}
	else if(Balance == 2)
	{
		Balance = 1;
		gTeam[0] = 1;
		
		print("Team 1");
	}
	return 1;
}
Why timer i donґt understand?
Can you change it to my teams (Policias and Terroristas) please...
Reply
#4

Tell me exactly which variable is responsible for two teams and the timer was just a debug for you to test the functionality (works!)
Reply
#5

Quote:
Originally Posted by F1N4L
Посмотреть сообщение
Tell me exactly which variable is responsible for two teams and the timer was just a debug for you to test the functionality (works!)
PHP код:
//Teams
static gTeam[MAX_PLAYERS];
#define Policias 1
#define Terroristas 2 
I want to only, if the team wich the user choose have more players than the other, gametextforplayer show to the user that the team is full and he only can spawn choosing other team...
Reply
#6

Код:
if(Balance == 0 || Balance == 1)
	{
		Balance = 2;
		gTeam[playerid] = Policias;
	}
	else if(Balance == 2)
	{
		Balance = 1;
		gTeam[playerid] = Terroristas;
	}
Because it's in Portuguese?
Reply
#7

Quote:
Originally Posted by F1N4L
Посмотреть сообщение
Код:
if(Balance == 0 || Balance == 1)
	{
		Balance = 2;
		gTeam[playerid] = Policias;
	}
	else if(Balance == 2)
	{
		Balance = 1;
		gTeam[playerid] = Terroristas;
	}
Because it's in Portuguese?
It's Spanish e.e
Reply
#8

Words are like, I 'm Brazilian!

Test and if it does not post here again

****** translator did not do it right! hahaha sorry
Reply
#9

Quote:
Originally Posted by F1N4L
Посмотреть сообщение
Words are like, I 'm Brazilian!

Test and if it does not post here again
I think you didn't understood me. I want when player connect and when is OnPlayerClassRequest, if he choose Team Policias and this team have more players than the other, he cannot spawn as Policia, he must spawn like a Terrorista.
Reply
#10

Код:
new team = (AllTeamPlayersVariable % 2 == 0) ? 1 : 2;
gTeam[playerid] = team;
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)