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

l4d2 help:How to get the number of players?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
dabaicai
Junior Member
Join Date: May 2011
Old 07-29-2013 , 10:39   l4d2 help:How to get the number of players?
Reply With Quote #1

There are several current players ,1 user ? or 3 or 9 user ?
With which a command ?

pls help me,brothers
............................................. ...

Last edited by dabaicai; 07-29-2013 at 10:40.
dabaicai is offline
dabaicai
Junior Member
Join Date: May 2011
Old 07-29-2013 , 11:14   Re: l4d2 help:How to get the number of players?
Reply With Quote #2

i have a bad id, use IsPlayerAlive() traversal ,,ok ???
dabaicai is offline
Silvers
SourceMod Plugin Approver
Join Date: Aug 2010
Location: SpaceX
Old 07-29-2013 , 11:57   Re: l4d2 help:How to get the number of players?
Reply With Quote #3

PHP Code:
new count;
new 
alive;
for( new 
1<= MaxClientsi++ )
{
    if( 
IsClientInGame(i) )
    {
        
count++;
        if( 
IsPlayerAlive(i) )
        {
            
alive++;
        }
    }
}

PrintToChatAll("%d players alive out of %d"alivecount); 
???
__________________
Silvers is offline
dabaicai
Junior Member
Join Date: May 2011
Old 07-29-2013 , 12:51   Re: l4d2 help:How to get the number of players?
Reply With Quote #4

yes ,i am

Last edited by dabaicai; 07-29-2013 at 23:42.
dabaicai is offline
Silvers
SourceMod Plugin Approver
Join Date: Aug 2010
Location: SpaceX
Old 07-29-2013 , 13:03   Re: l4d2 help:How to get the number of players?
Reply With Quote #5

great, me too.
__________________
Silvers 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 06:39.


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