How do i make a class limit?
#1

I made a new thread since no one was going to answer 5 questions in ne thread, so i ask-
How do i make a limit for a class (only one player ma choose this class) and a limit that depends on how many players other classes have (like there can only be a diffrence a diffrence of 2 people between cops and robbers team, I.E- there can be 4 cops and the player wont be allowed to choose cops if there isnt 3-5 robbers, and vice versa)?
HUUUUGE Thanks in advance.
P.S- sorry if my english isnt perfect, im not English speaking.
Reply
#2

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

I'm feeling generous today

pawn Код:
// Defines
new TeamPlayers[Number_Of_Teams],
  gTeam[MAX_PLAYERS];

// OnPlayerRequestClass
gTeam[playerid] = classid;

// OnPlayerRequestSpawn
if(TeamPlayers[gTeam[playerid] >= Max_Team_Members)
{
   SendClientMessage(playerid, RED, "This team is full.");
   return 0;
}

// OnPlayerSpawn
TeamPlayers[gTeam[playerid]]++;

// OnPlayerDeath
TeamPlayers[gTeam[playerid]]--;
Should work, I think (untested).
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)