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

[Help] Get total players


Post New Thread Reply   
 
Thread Tools Display Modes
Adventx
Member
Join Date: Feb 2014
Location: Romania
Old 08-24-2017 , 18:48   Re: [Help] Get total players
Reply With Quote #21

PHP Code:
// Get CTs -returns number of CTs connected- 
fnGetCTs() 

    static 
iCTsid 
    iCTs 

     
    
for (id 1id <= g_maxplayersid++) 
    { 
        if (
g_isconnected[id]) 
        {             
            if (
fm_cs_get_user_team(id) == FM_CS_TEAM_CT
                
iCTs++ 
        } 
    } 
     
    return 
iCTs


// Get Ts -returns number of Ts connected- 
fnGetTs() 

    static 
iTsid 
    iTs 

     
    
for (id 1id <= g_maxplayersid++) 
    { 
        if (
g_isconnected[id]) 
        {             
            if (
fm_cs_get_user_team(id) == FM_CS_TEAM_T
                
iTs++ 
        } 
    } 
     
    return 
iTs


// Get Alive CTs -returns number of CTs alive- 
fnGetAliveCTs() 

    static 
iCTsid 
    iCTs 

     
    
for (id 1id <= g_maxplayersid++) 
    { 
        if (
g_isalive[id]) 
        {             
            if (
fm_cs_get_user_team(id) == FM_CS_TEAM_CT
                
iCTs++ 
        } 
    } 
     
    return 
iCTs


// Get Alive Ts -returns number of Ts alive- 
fnGetAliveTs() 

    static 
iTsid 
    iTs 

     
    
for (id 1id <= g_maxplayersid++) 
    { 
        if (
g_isalive[id]) 
        {             
            if (
fm_cs_get_user_team(id) == FM_CS_TEAM_T
                
iTs++ 
        } 
    } 
     
    return 
iTs

CAN someone combine there function in one stock, with FOR LOOP, without function
PHP Code:
get_players() 
I need to check the player team (including both teams, if case) and if it's alive or not (including both option, alive and dead)

PHP Code:
team    Terrorist        CTerrorist    Both
alive    Alive            Death    Both 
Adventx is offline
Send a message via Yahoo to Adventx
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:18.


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