Raised This Month: $535 Target: $400
 133% 

get_playersnum() help


Post New Thread Reply   
 
Thread Tools Display Modes
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 08-19-2018 , 14:40   Re: get_playersnum() help
Reply With Quote #11

Quote:
Originally Posted by thisisinfuriating View Post
Well, wouldn't that stop it from counting stats if there's less than 6 players, and re-enable it when more or equal to 6 players join?
No, it simply returns 0 when there's less than 6 players, nothing else.
__________________
edon1337 is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 08-19-2018 , 14:44   Re: get_playersnum() help
Reply With Quote #12

You should just use a variable to determine whether or not stats should be counted based on player count.

PHP Code:
new bool:g_bPaused;

//Check at round start or something
g_bPaused bool:( get_playersnum() < );

//Where you track stats
if ( !g_bPaused )
{
     
//record stats

__________________
Bugsy is offline
thisisinfuriating
Junior Member
Join Date: Aug 2018
Old 08-19-2018 , 14:45   Re: get_playersnum() help
Reply With Quote #13

Quote:
Originally Posted by edon1337 View Post
No, it simply returns 0 when there's less than 6 players, nothing else.
PHP Code:
    new Players[32], NumTNumCT;
    
get_players(PlayersNumT"eh""TERRORIST");
    
get_players(PlayersNumCT"eh""CT");

    if((
NumT NumCT) < 6)
        return 
0
Would adding this at NativeGetProgress in the API do the job?
thisisinfuriating is offline
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 08-19-2018 , 14:53   Re: get_playersnum() help
Reply With Quote #14

Quote:
Originally Posted by thisisinfuriating View Post
PHP Code:
    new Players[32], NumTNumCT;
    
get_players(PlayersNumT"eh""TERRORIST");
    
get_players(PlayersNumCT"eh""CT");

    if((
NumT NumCT) < 6)
        return 
0
Would adding this at NativeGetProgress in the API do the job?
Use Bugsy's code.
__________________

Last edited by edon1337; 08-19-2018 at 14:53.
edon1337 is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 08-19-2018 , 15:03   Re: get_playersnum() help
Reply With Quote #15

Quote:
Originally Posted by edon1337 View Post
Use Bugsy's code.
My code counts all players regardless of team assignment. If he wants to count only those on a team then he will need additional code.
__________________
Bugsy is offline
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 08-19-2018 , 15:06   Re: get_playersnum() help
Reply With Quote #16

Quote:
Originally Posted by Bugsy View Post
My code counts all players regardless of team assignment. If he wants to count only those on a team then he will need additional code.
No, he wants the general number of connected players, so your code is just fine.
__________________
edon1337 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 18:43.


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