[SOLVED] Team Balance
#1

Hi,
I know it has been posted before, but in the posts before I didn't really get it ;S
Can some1 just give me the code?

Thanks (:
Reply
#2

http://forum.sa-mp.com/index.php?topic=64320.0
Reply
#3

Quote:
Originally Posted by -xy!
Quote:
Originally Posted by Sly™
Quote:
Originally Posted by Seif_
Change the returns message to this:
pawn Код:
return SendClientMessage(playerid, color_here, "This team is full!"), 0;
It will return 0 so you can't spawn.
Would be easier to understand using this:
pawn Код:
return !SendClientMessage(playerid, color_here, "This team is full!");
The SendClientMessage returns 1 if message was received by the client and 0 if not. So, if the player didn't receive the message, let him spawn to avoid problems
I tried both way, but I'm still getting an error;
Код:
warning 209: function "OnPlayerRequestSpawn" should return a value
My Code;
Код:
public OnPlayerRequestSpawn(playerid)
{
  for(new p = 0; p < GetMaxPlayers(); p++)
	{
	  if (GetPlayerTeam(p) == TEAM_ARMY)
	  {
	    ArmyCount++;
	  }
  	else if (GetPlayerTeam(p) == TEAM_TERROR)
  	{
    	TerrorCount++;
  	}
	}
	if ((ArmyCount > TerrorCount) && GetPlayerTeam(playerid) == TEAM_ARMY)
	  return !SendClientMessage(playerid, COLOR_RED, ">> This team is full!");
	else if ((TerrorCount > ArmyCount) && GetPlayerTeam(playerid) == TEAM_TERROR)
	  return !SendClientMessage(playerid, COLOR_RED, ">> This team is full!");
}
Thanks! (:
Reply
#4

Just make it return 1, it should remove the warning.
Reply
#5

Quote:
Originally Posted by Zeromanster
Just make it return 1, it should remove the warning.
Oke (: Thanks, it worked!
Reply
#6

Quote:
Originally Posted by Nameless303
Quote:
Originally Posted by Zeromanster
Just make it return 1, it should remove the warning.
Oke (: Thanks, it worked!
Now theres something else wrong; When I try to join whatever team it says it's full ;S

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)