Raised This Month: $51 Target: $400
 12% 

How to get the amount of players in both teams?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ronmelkhior
Member
Join Date: Aug 2013
Old 08-11-2013 , 07:48   How to get the amount of players in both teams?
Reply With Quote #1

I'm looking to make a plugin which will be only enabled once there are at-least 8 players in both teams (So it won't count spectators), how is it done? Thanks! I'm talking about TF2 if it matters

Last edited by ronmelkhior; 08-11-2013 at 08:19. Reason: Adding TF2
ronmelkhior is offline
pTu
Senior Member
Join Date: Nov 2010
Location: Poland
Old 08-11-2013 , 10:28   Re: How to get the amount of players in both teams?
Reply With Quote #2

Chceck:
Code:
GetPlayerCount()
{
    new players;
    for (new i = 1; i <= MaxClients; i++)
    {
        if (IsClientInGame(i) && !IsFakeClient(i) && GetClientTeam(i)>=2)
            players++;
    }
    return players;
}
pTu is offline
TnTSCS
AlliedModders Donor
Join Date: Oct 2010
Location: Undisclosed...
Old 08-11-2013 , 10:28   Re: How to get the amount of players in both teams?
Reply With Quote #3

SMLib has this code for you.

Team_GetClientCounts
__________________
View my Plugins | Donate
TnTSCS is offline
DJ Tsunami
DJ Post Spammer
Join Date: Feb 2008
Location: The Netherlands
Old 08-11-2013 , 10:45   Re: How to get the amount of players in both teams?
Reply With Quote #4

PHP Code:
if(GetTeamClientCount(_:TFTeam_Blue) >= && GetTeamClientCount(_:TFTeam_Red) >= 8
__________________
Advertisements | REST in Pawn - HTTP client for JSON REST APIs
Please do not PM me with questions. Post in the plugin thread.

Last edited by DJ Tsunami; 08-11-2013 at 10:49.
DJ Tsunami is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 22:08.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode