Raised This Month: $ Target: $400
 0% 

check team player number


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
K.K.Lv
Veteran Member
Join Date: Aug 2008
Location: GameFolder
Old 07-21-2010 , 21:41   Re: check team player number
Reply With Quote #10

PHP Code:
stock get_team_playernum(iTeam) {
    static 
players[32], num
    
static iNum
    get_players
(playersnum)
    for (new 
0numi++) {
        if (
get_user_team(players[i]) == iTeam) {
            
iNum++
        }
    }
    return 
iNum

un-test.

Quote:
should add a bool and set it true when he connects and false when he disconnects
you can do it like the following code, then, I think you needn't to check when player disconnect.
should work:
PHP Code:
 
const BOOL_ARRAY[33] = {false,...}
 
new 
bool:g_bvar[33]
 
public 
client_connect(id) {
    
g_bvar BOOL_ARRAY
    g_bvar
[id] = true

__________________
QQ:116268742

Last edited by K.K.Lv; 07-21-2010 at 21:52.
K.K.Lv is offline
Send a message via MSN to K.K.Lv
 



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 07:07.


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