Raised This Month: $ Target: $400
 0% 

HELP MAX_PLAYERS, MAX_CLIENTS, MaxClients


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
soumyadip77
Senior Member
Join Date: Jul 2017
Location: INDIA,KOLKATA
Old 04-28-2018 , 02:28   HELP MAX_PLAYERS, MAX_CLIENTS, MaxClients
Reply With Quote #1

Any one can tell me the difference between MAX_PLAYERS, MAX_CLIENTS, MaxClients
soumyadip77 is offline
Send a message via Skype™ to soumyadip77
Natsheh
Veteran Member
Join Date: Sep 2012
Old 04-28-2018 , 02:51   Re: HELP MAX_PLAYERS, MAX_CLIENTS, MaxClients
Reply With Quote #2

All are the same, it holds server max players slots.
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !


Last edited by Natsheh; 04-28-2018 at 02:52.
Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
klippy
AlliedModders Donor
Join Date: May 2013
Location: Serbia
Old 04-28-2018 , 04:12   Re: HELP MAX_PLAYERS, MAX_CLIENTS, MaxClients
Reply With Quote #3

Only MAX_PLAYERS and MaxClients exist in AMXX 1.8.3. MAX_PLAYERS is a constant that's set to 32 (maximum number of players on any server), and MaxClients is the number of player slots on the server running that plugin (up to 32) - basically sv_maxplayers.
__________________
klippy is offline
soumyadip77
Senior Member
Join Date: Jul 2017
Location: INDIA,KOLKATA
Old 04-28-2018 , 21:49   Re: HELP MAX_PLAYERS, MAX_CLIENTS, MaxClients
Reply With Quote #4

That mens i can use MAXClients to get how many players available in server without get_maxplayers right??

MAX_CLIENTS IN reapi
soumyadip77 is offline
Send a message via Skype™ to soumyadip77
CrAzY MaN
Senior Member
Join Date: Mar 2017
Location: India
Old 04-28-2018 , 23:19   Re: HELP MAX_PLAYERS, MAX_CLIENTS, MaxClients
Reply With Quote #5

Quote:
Originally Posted by soumyadip77 View Post
That mens i can use MAXClients to get how many players available in server without get_maxplayers right??

MAX_CLIENTS IN reapi
Nope, MAXClients is for the number of slots your server have.
E.G. I have 16 slots server. So, MAXClients=16

get_maxplayers() is used for the total number of players playing in your server.
E.G. I have 16 slots server. Number of players playing now is 10. So get_maxplayers() <=10

I hope it is correct!
__________________
CrAzY MaN is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 04-28-2018 , 23:33   Re: HELP MAX_PLAYERS, MAX_CLIENTS, MaxClients
Reply With Quote #6

Quote:
Originally Posted by CrAzY MaN View Post
Nope, MAXClients is for the number of slots your server have.
E.G. I have 16 slots server. So, MAXClients=16

get_maxplayers() is used for the total number of players playing in your server.
E.G. I have 16 slots server. Number of players playing now is 10. So get_maxplayers() <=10

I hope it is correct!
That is incorrect. get_maxplayers() will be the number of available slots on the server (in your example, it will always be 16). To get the number of players currently in the server you use get_playersnum().

You need to do some basic checking before you post. Please don't post if you know that you're not sure.
__________________

Last edited by fysiks; 04-28-2018 at 23:33.
fysiks is offline
CrAzY MaN
Senior Member
Join Date: Mar 2017
Location: India
Old 04-28-2018 , 23:38   Re: HELP MAX_PLAYERS, MAX_CLIENTS, MaxClients
Reply With Quote #7

If i have 16 slots server in which i have 3 bots.
Then get_maxlplayers=13?
__________________
CrAzY MaN is offline
E1_531G
Senior Member
Join Date: Dec 2017
Old 04-29-2018 , 08:09   Re: HELP MAX_PLAYERS, MAX_CLIENTS, MaxClients
Reply With Quote #8

Quote:
Originally Posted by CrAzY MaN View Post
If i have 16 slots server in which i have 3 bots.
Then get_maxlplayers=13?
No. get_maxplayers() is equal to amount of the server slots.
If you start the server with 10 slots, you will have get_maxplayers() = 10.
__________________
My English is A0
E1_531G is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 04-29-2018 , 10:32   Re: HELP MAX_PLAYERS, MAX_CLIENTS, MaxClients
Reply With Quote #9

This is not that complicated. If you set your server to 15 slots, then get_maxplayers() returns 15.

As mentioned, MAX_PLAYERS is set to 32 which is the max number of players that a HL1 server supports. This constant can be used for sizing arrays since you cannot use a non-constant, such as get_maxplayers(), for this purpose. The value returned by get_maxplayers() can be used for run-time conditions, such as max iterations for a loop or something.
__________________
Bugsy 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 08:29.


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