Raised This Month: $ Target: $400
 0% 

does "get_playersnum()" count connecting players?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
FeuerSturm
AlliedModders Donor
Join Date: Apr 2004
Old 05-05-2004 , 17:12   does "get_playersnum()" count connecting players?
Reply With Quote #1

hey people!

here's my question:

does
Code:
get_playersnum()
count the players that are in game,
or does it count the players that are connecting as well?

the amxmodx.inc says:
Code:
/* Returns number of players put in server. 
* If flag is set then also connecting are counted. */
native get_playersnum(flag=0);
that is confusing me.

has it to be
Code:
get_playersnum(0)
to count connecting players as well?

please help me
FeuerSturm is offline
Johnny got his gun
Veteran Member
Join Date: Jan 2004
Location: Tokyo
Old 05-05-2004 , 17:31  
Reply With Quote #2

"Set" would mean that the argument is non-false, i.e., it's true, which it would if you'd set it to anything but 0. (1 is fine)

0 = false
1 = true
2 = true
3 = true
-1 = true
-2 = true
324234 = true
-93243 = true

... and so on... I hope you get the picture =)
Johnny got his gun is offline
FeuerSturm
AlliedModders Donor
Join Date: Apr 2004
Old 05-05-2004 , 17:45  
Reply With Quote #3

yes, thank you johnny!

now another question:

this is from BigBallers's "Simple Redirection"-plugin:

Code:
get_playersnum() >= rd_maxplayers

now i changed it to:
Code:
get_playersnum(1) >= rd_maxplayers

can i change that to:
Code:
get_playersnum(1) == rd_maxplayers
to redirect players if exactly the amount of players that is set for
"rd_maxplayers" are connected/connecting?
or will that not work at all?

thank you in advance, i really want to get that to work
FeuerSturm is offline
IceMouse[WrG]
Senior Member
Join Date: Mar 2004
Old 05-05-2004 , 22:02  
Reply With Quote #4

Yes... But it could be potentially buggy
IE: It's 1 away from the max, and 2 people join at the same time
It catches the first player and redirects him, but before the command gets to him and disconnects him, the playercount is still risen when the 2nd one gets in the server, so the player count is and always will be when someone connects rd_maxplayers+1, rendering the plugin useless until someone else connects
IceMouse[WrG] is offline
Send a message via AIM to IceMouse[WrG] Send a message via MSN to IceMouse[WrG] Send a message via Yahoo to IceMouse[WrG]
FeuerSturm
AlliedModders Donor
Join Date: Apr 2004
Old 05-06-2004 , 01:51  
Reply With Quote #5

i get what you mean, IceMouse.

so would work maybe setting it to:

Code:
get_playersnum(1) >> rd_maxplayers

because my problem is that it seems that players aren't redirected
at all when i use the code from the original plugin:
Code:
if ( get_playersnum() >= rd_maxplayers)

i got two 16 slot public servers, both with "Admin Slots f117bomb Style"
set to not hide the reserved slot.

at first it seemed that the plugin wasn't counting connecting players,
so it didn't do anything.
but now something is still wrong.

so if i set use:
Code:
get_playersnum(1) >> rd_maxplayers

and set "rd_maxplayers" to "14", will it start to redirect players
as soon as the 15th player joined?
or will it start to redirect as soon as 14 players are on?[/small]
FeuerSturm 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 00:45.


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