Raised This Month: $ Target: $400
 0% 

Get maxplayers startup arg value ?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Arkarr
Veteran Member
Join Date: Sep 2012
Location: Just behind my PC screen
Old 06-17-2016 , 03:07   Get maxplayers startup arg value ?
Reply With Quote #1

I would like to know how to get the maxium slots of a cs:go server. I was using "MaxClients" variables, but it always return me 64.
PHP Code:
srcds.exe -game csgo -console -usercon +game_type 0 +game_mode 1 +mapgroup mg_active +map de_dust2 -port 27022 -maxplayers 32 
__________________
Want to check my plugins ?
Arkarr is offline
Impact123
Veteran Member
Join Date: Oct 2011
Location: Germany
Old 06-17-2016 , 04:04   Re: Get maxplayers startup arg value ?
Reply With Quote #2

You could try to use GetCommandLineParamInt.
PHP Code:
int maxplayers GetCommandLineParamInt("-maxplayers", -1); 
__________________

Last edited by Impact123; 06-17-2016 at 04:07.
Impact123 is offline
Arkarr
Veteran Member
Join Date: Sep 2012
Location: Just behind my PC screen
Old 06-17-2016 , 04:11   Re: Get maxplayers startup arg value ?
Reply With Quote #3

Is it okay to use that function to retrieve the number of maximum clients or it's not recommended ?
What I really need is just to grab the number of slots for players.

EDIT:
The real slot number may differ from the argument, right ? for exemple, if I set this : -maxplayers 347557328957325 the value won't be correct because the maximum number of slots might be resized to 64 ?
__________________
Want to check my plugins ?

Last edited by Arkarr; 06-17-2016 at 04:13.
Arkarr is offline
Impact123
Veteran Member
Join Date: Oct 2011
Location: Germany
Old 06-17-2016 , 04:28   Re: Get maxplayers startup arg value ?
Reply With Quote #4

My knowledge of cs:go is very limited, not sure if it's recommended or how others do this. I only posted because you specifically asked how to get the command line arg in the title.
Quote:
Originally Posted by Arkarr View Post
The real slot number may differ from the argument, right ?
I tested with cs:s and it returned 32 despite giving 9000 as argument.
__________________

Last edited by Impact123; 06-17-2016 at 04:35.
Impact123 is offline
Arkarr
Veteran Member
Join Date: Sep 2012
Location: Just behind my PC screen
Old 06-17-2016 , 04:42   Re: Get maxplayers startup arg value ?
Reply With Quote #5

Thanks !
__________________
Want to check my plugins ?
Arkarr is offline
psychonic

BAFFLED
Join Date: May 2008
Old 06-17-2016 , 15:23   Re: Get maxplayers startup arg value ?
Reply With Quote #6

I've detailed this in a few other threads, but it's probably quicker to retype a summary rather than find one of them.

CS:GO always runs with a maxplayers of 64 (or 65 with SourceTV) and ignores any given "-maxplayers" parameters. 1 - 64/65 inclusive will always be valid (potential) client indexes on there for the purpose of IsClientInGame, etc.

It then limits the player count using a newer feature from L4D and later, called Max Human Players. (This is what gets set with the +maxplayers_override, new in CS:GO, and the maxplayers value given in the gamemodes_server.txt config). You can use the SM native GetMaxHumanPlayers to return the resolved value of this.
psychonic is offline
Arkarr
Veteran Member
Join Date: Sep 2012
Location: Just behind my PC screen
Old 06-17-2016 , 17:58   Re: Get maxplayers startup arg value ?
Reply With Quote #7

Not sure if I miss undertood something but, GetMaxHumanPlayers() return 1. What the hell ?
__________________
Want to check my plugins ?
Arkarr is offline
wrox
Member
Join Date: Nov 2009
Location: /root
Old 06-17-2016 , 18:30   Re: Get maxplayers startup arg value ?
Reply With Quote #8

Quote:
Originally Posted by Arkarr View Post
Not sure if I miss undertood something but, GetMaxHumanPlayers() return 1. What the hell ?
I second this. Since yesterday, GetMaxHumanPlayers() return 1 for me as well. It worked great for years prior.
__________________

wrox 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 09:43.


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