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
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;
}
}
}
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.
for(new teams; teams < [2]; teams++)
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;
}
}
}
use this tested
At the top add Код:
new TeamPlayers[ <Amount of teams here> ]; 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.