SA-MP Forums Archive
Hot to put a limit for a team ? like in this team .... - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Hot to put a limit for a team ? like in this team .... (/showthread.php?tid=128027)



Hot to put a limit for a team ? like in this team .... - AlbanianGuy - 16.02.2010

Like in this team TEAMb only has to have 2 players playing as TEAMb .. you know what i mean ?


Re: Hot to put a limit for a team ? like in this team .... - Norn - 16.02.2010

Quote:
Originally Posted by AlbanianGuy
Like in this team TEAMb only has to have 2 players playing as TEAMb .. you know what i mean ?
new teambcount;

Player joins teamb: teambcount++;

pawn Код:
if(teambcount >= 2)
{
// Do whatever here.
}



Re: Hot to put a limit for a team ? like in this team .... - AlbanianGuy - 16.02.2010

Can you be more specific ... like can u do it for TEAMb ... pls cuz i am new in scripting ..


Re: Hot to put a limit for a team ? like in this team .... - Norn - 16.02.2010

Quote:
Originally Posted by AlbanianGuy
Can you be more specific ... like can u do it for TEAMb ... pls cuz i am new in scripting ..
I don't think it's possible to be anymore specific..

When the player joins teamb do what i said above, and run the checks to see if the team is full if the team is full do what you have planned.


Re: Hot to put a limit for a team ? like in this team .... - AlbanianGuy - 16.02.2010

Quote:
Originally Posted by Norn
Quote:
Originally Posted by AlbanianGuy
Like in this team TEAMb only has to have 2 players playing as TEAMb .. you know what i mean ?
new teambcount;

Player joins teamb: teambcount++;

pawn Код:
if(teambcount >= 2)
{
// Do whatever here.
}
so i go like this ?
new TEAMbcount ( ok this one i know .. )
public onplayerrequestclass ( i put his here ?)
if(TEAMbcount >=2) ( so the number 2 is the max number of players ?
{
SnedClientMessage(playerid, COLOR_RED ,"YOU CANT JOIN THIS TEAM ...");
}






Re: Hot to put a limit for a team ? like in this team .... - ruckfules99 - 16.02.2010

Код:
new TeamCount = 0;

//When person enters team
TeamCount++;

//When persons leaves team
TeamCount--;

//Then to see if its full
if(TeamCount >= 15)
{
   SendClientMessage(playerid,red,"Team is full!");
}



Re: Hot to put a limit for a team ? like in this team .... - AlbanianGuy - 16.02.2010

Quote:
Originally Posted by ruckfules99
Код:
new TeamCount = 0;

//When person enters team
TeamCount++;

//When persons leaves team
TeamCount--;

//Then to see if its full
if(TeamCount >= 15)
{
   SendClientMessage(playerid,red,"Team is full!");
}
and where do i put these ? ok i know the first one .. on the very top .. howa boaut hte others ? onplayer request sapwn ? where ?


Re: Hot to put a limit for a team ? like in this team .... - AlbanianGuy - 16.02.2010

bumpp