Team balance
#1

Hey guys. How to use teambalance with gTeam?

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

/emberrased.
Reply
#2

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
Reply
#3

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
Reply
#4

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.
Reply
#5

show us your line number 31
Reply
#6

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

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;
    }
  }
}
Reply
#8

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?
Reply
#9

what error does it gave
Reply
#10

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)