Raised This Month: $ Target: $400
 0% 

[SOLVED] get_players without flags


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
GalegO
Member
Join Date: May 2010
Location: Brazil
Old 11-03-2011 , 11:51   [SOLVED] get_players without flags
Reply With Quote #1

Hi, for exemple, I have this cobe below:

PHP Code:
public function()
{
        new 
playersT[32], numTplayersNum
        playersNum 
get_playersnum()
        
get_players(playersTnumT"che""TERRORIST")
        
        if ((
playersNum >= 2) && (numT == 0))
        {
            ... do 
something ...
        }

And I know the AMX MOD return wrong values when using get_players + flags, knowing this, I ask: What's the better way to do this same code without the flags?

Thanks!
__________________
Sou brasileiro e não desisto NUNCA!
I'm Brazilian and NEVER give up!

Loucademia de CZ (lcz # GalegO)
CZ CrazyAcademy
189.1.164.85:27017


Last edited by GalegO; 11-05-2011 at 15:53.
GalegO is offline
Emp`
AMX Mod X Plugin Approver
Join Date: Aug 2005
Location: Decapod 10
Old 11-03-2011 , 12:19   Re: get_players without flags
Reply With Quote #2

Code:
        new players[32], pnum, numT, playersNum
        playersNum = get_playersnum()
        get_players(players, pnum, "ch")
        
        for ( new i; i<pnum; i++ )
        {
                if ( cs_get_user_team( players[i] ) == CS_TEAM_T )
                        numT++;
        }

        if ((playersNum >= 2) && (numT == 0))
        {
            ... do something ...
        }
Emp` is offline
Send a message via AIM to Emp` Send a message via MSN to Emp` Send a message via Yahoo to Emp` Send a message via Skype™ to Emp`
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 11-03-2011 , 13:28   Re: get_players without flags
Reply With Quote #3

Emp`'s code is ok.
Flags are ok, excepted for "e" flag when "a" flag is not used.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 11-04-2011 , 01:40   Re: get_players without flags
Reply With Quote #4

We need to convince Bail to give us another christmas present this year!
__________________
fysiks is offline
GalegO
Member
Join Date: May 2010
Location: Brazil
Old 11-05-2011 , 15:53   Re: get_players without flags
Reply With Quote #5

Thank you Emp` and Connor!!
__________________
Sou brasileiro e não desisto NUNCA!
I'm Brazilian and NEVER give up!

Loucademia de CZ (lcz # GalegO)
CZ CrazyAcademy
189.1.164.85:27017


Last edited by GalegO; 11-05-2011 at 15:53.
GalegO is offline
Reply


Thread Tools
Display Modes

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


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