Raised This Month: $ Target: $400
 0% 

get_playersnum(1) without bots help.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
zacky
Senior Member
Join Date: Mar 2008
Location: Sweden
Old 06-20-2009 , 12:13   get_playersnum(1) without bots help.
Reply With Quote #1

How can i do like get_playersnum(1) >= 2 and it only returns the numbers of players that is not bots?

Thanks
-zacky
zacky is offline
Send a message via Skype™ to zacky
biscuit628
Senior Member
Join Date: Jun 2007
Location: 香港HongKong
Old 06-20-2009 , 12:50   Re: get_playersnum(1) without bots help.
Reply With Quote #2

Quote:
Originally Posted by zacky View Post
How can i do like get_playersnum(1) >= 2 and it only returns the numbers of players that is not bots?

Thanks
-zacky
PHP Code:
    for (new id 1id <= g_maxplayersid++)
    {
        if(!
is_user_bot(id))
        {
            
totalplayer++
        }
    } 
__________________
My Plugins

C4man with fun

Sniper Skill bonus
-------------------------
Sorry for my poor English!
biscuit628 is offline
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 06-20-2009 , 13:07   Re: get_playersnum(1) without bots help.
Reply With Quote #3

Use get_players()

There is flag to skip bots, so you will know num of real players
__________________
xPaw is offline
Old 06-20-2009, 13:33
SnoW
This message has been deleted by SnoW. Reason: ...
zacky
Senior Member
Join Date: Mar 2008
Location: Sweden
Old 06-20-2009 , 16:24   Re: get_playersnum(1) without bots help.
Reply With Quote #4

Can you show an example?

I want to detect if there is like 2 people connected or three which is not bots.

Let me explain what i'm going to do.

I am going to do that if there is 1 player connected (not bot) i am going to do something in there, if there is 2 players connected (not bots) do something else.

Last edited by zacky; 06-20-2009 at 16:32.
zacky is offline
Send a message via Skype™ to zacky
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 06-20-2009 , 16:49   Re: get_playersnum(1) without bots help.
Reply With Quote #5

http://www.amxmodx.org/funcwiki.php?go=func&id=174
PHP Code:
    new iPlayers32 ], iNum;
    
get_playersiPlayersiNum"ch" );
    
    if( 
iNum >= ) {
        
// your stuff -.-
    

That hard to watch funcwiki ?!
__________________
xPaw is offline
zacky
Senior Member
Join Date: Mar 2008
Location: Sweden
Old 06-20-2009 , 16:51   Re: get_playersnum(1) without bots help.
Reply With Quote #6

Thanks xPaw
zacky is offline
Send a message via Skype™ to zacky
tpt
Member
Join Date: Jun 2009
Location: Scripting help section
Old 06-20-2009 , 17:10   Re: get_playersnum(1) without bots help.
Reply With Quote #7

Quote:
Originally Posted by xPaw View Post
http://www.amxmodx.org/funcwiki.php?go=func&id=174
PHP Code:
    new iPlayers32 ], iNum;
    
get_playersiPlayersiNum"ch" );
    
    if( 
iNum >= ) {
        
// your stuff -.-
    

That hard to watch funcwiki ?!
Quote:
"We don't really support get_players() with flags anymore. It was a bad idea and if it was our choice, it would have never been added to the original AMX Mod." - BAILOPAN
tpt is offline
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 06-20-2009 , 17:13   Re: get_playersnum(1) without bots help.
Reply With Quote #8

The comment is not really true the flags work fine
__________________
xPaw is offline
tpt
Member
Join Date: Jun 2009
Location: Scripting help section
Old 06-20-2009 , 17:14   Re: get_playersnum(1) without bots help.
Reply With Quote #9

Quote:
Originally Posted by xPaw View Post
The comment is not really true the flags work fine

@Zacky:
PHP Code:
stock bool:IsTwoOrMore( ) {
    new 
iPlayers32 ], iNum;
    
get_playersiPlayersiNum"ch" );
    
    if( 
iNum >= )
        return 
true;
    
    return 
false;

Comment from: http://www.amxmodx.org/funcwiki.php?go=func&id=174

Even if it works it doesn't mean that you should use it. ;)
tpt is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 06-20-2009 , 17:47   Re: get_playersnum(1) without bots help.
Reply With Quote #10

Quote:
Originally Posted by tpt View Post
Comment from: http://www.amxmodx.org/funcwiki.php?go=func&id=174

Even if it works it doesn't mean that you should use it. ;)
You act like you know about the function.
get_players() works for most flags, but a few flags such as team can be a bit buggy.
That is why they say it shouldn't be used.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] 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 21:19.


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