Raised This Month: $ Target: $400
 0% 

How to check players in teams?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
BrundiX
Junior Member
Join Date: Dec 2010
Old 10-31-2011 , 15:02   Re: How to check players in teams?
Reply With Quote #7

How about this?:
PHP Code:
#include <amxmodx>

new _gMaxPlayers;

public 
plugin_init()
{
    
set_task(133.7"_Function")
    
    
_gMaxPlayers get_maxplayers();
}

public 
_Function()
{
    if(
_This_Boolean())
    {
        
server_print("Theres more then five players in each team");
    }
    
    
/* Code */
    
    /* ......................... */
}

stock bool:_This_Boolean()
{
    new 
_tPl_CtPl;
    
    for(new 
i<= _gMaxPlayersi++)
    {
        if(
is_user_connected(i))
        {
            switch(
get_user_team(i))
            {
                case 
1:
                {
                    
_tPl++;
                }
                case 
2:
                {
                    
_CtPl++;
                }
            }
        }
    }
    if(
_tPl && _CtPl 5)
    {
        return 
true;
    }
    else
    {
        return 
false;
    }
    
    return 
false;

BrundiX is offline
 



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 14:18.


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