Raised This Month: $ Target: $400
 0% 

sv_visiblemaxplayers not working in server.cfg


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Marverlous
Senior Member
Join Date: May 2013
Old 07-06-2015 , 21:05   sv_visiblemaxplayers not working in server.cfg
Reply With Quote #1

Hello guys, for some reason the cvar sv_visiblemaxplayers refuses to work in my server config. I even tried putting it in autoexec.cfg to no avail. However if I execute the cvar in the console, it work fine. Any help would be appreciated.

Thanks for reading.
__________________
Marverlous is offline
Ade
I love purple
Join Date: May 2010
Old 07-07-2015 , 07:51   Re: sv_visiblemaxplayers not working in server.cfg
Reply With Quote #2

reserved slots present?
__________________
Ade is offline
Marverlous
Senior Member
Join Date: May 2013
Old 07-07-2015 , 11:27   Re: sv_visiblemaxplayers not working in server.cfg
Reply With Quote #3

Not at all.
__________________
Marverlous is offline
Wilczek
AlliedModders Donor
Join Date: Oct 2012
Location: Poland
Old 07-07-2015 , 13:29   Re: sv_visiblemaxplayers not working in server.cfg
Reply With Quote #4

Something must be overwriting it. Check your configs once again. Autoexec is one of the very first executed, so putting cvar there isn't a solution.
__________________
Wilczek is offline
Potato Uno
Veteran Member
Join Date: Jan 2014
Location: Atlanta, Georgia
Old 07-07-2015 , 14:02   Re: sv_visiblemaxplayers not working in server.cfg
Reply With Quote #5

If you're desperate, you can write a plugin that turns on this cvar 5 seconds after the map is loaded.

I have to do this in order to enable the hidden endless MvM mode since putting the cvars in any of the configs doesn't work.

Last edited by Potato Uno; 07-07-2015 at 14:02.
Potato Uno is offline
Marverlous
Senior Member
Join Date: May 2013
Old 07-07-2015 , 14:18   Re: sv_visiblemaxplayers not working in server.cfg
Reply With Quote #6

If possible, would you share the mentioned plugin? That would be swell, appreciate it.
__________________
Marverlous is offline
Potato Uno
Veteran Member
Join Date: Jan 2014
Location: Atlanta, Georgia
Old 07-07-2015 , 15:38   Re: sv_visiblemaxplayers not working in server.cfg
Reply With Quote #7

PHP Code:
public void OnMapStart()
{
    
CreateTimer(5.0ChangeCvar); // change 5.0 to more if it doesn't change it on time. this is the time in seconds and it must be a floating point number.
}

public 
Action ChangeCvar(Handle Timer)
{
    
// The shitty way:
    // ServerCommand("sv_visiblemaxplayers 24"); // change 24 to whatever

    // The more correct way:
    
Handle cvar FindConVar("sv_visiblemaxplayers");
    
SetConVarInt(cvar24); // change 24 to whatever
    
PrintToServer("Convar sv_visiblemaxplayers has been changed"); // debug print statement to server console - delete this once you're satisfied

You can paste that code in here https://spider.limetech.org/, edit whatever you want, then compile it and download the smx.

Last edited by Potato Uno; 07-07-2015 at 15:45. Reason: Forgot that the convar was specified in the OP
Potato Uno is offline
Marverlous
Senior Member
Join Date: May 2013
Old 07-07-2015 , 16:03   Re: sv_visiblemaxplayers not working in server.cfg
Reply With Quote #8

Thank you very much, I will test it right away.
__________________
Marverlous is offline
Marverlous
Senior Member
Join Date: May 2013
Old 07-08-2015 , 18:08   Re: sv_visiblemaxplayers not working in server.cfg
Reply With Quote #9

The code compile without trouble, but visiblemaxplayers still remains unchanged for some reason. Thank you for sharing nonetheless.

I checked both server.cfg and autoexec.cfg, nothing is overriding the cvar unless there's a stock config I'm unaware of.
__________________

Last edited by Marverlous; 07-08-2015 at 18:10.
Marverlous is offline
micazoid
Veteran Member
Join Date: Oct 2010
Location: Munich - Germany
Old 07-10-2015 , 11:43   Re: sv_visiblemaxplayers not working in server.cfg
Reply With Quote #10

Quote:
Originally Posted by Marverlous View Post
The code compile without trouble, but visiblemaxplayers still remains unchanged for some reason. Thank you for sharing nonetheless.

I checked both server.cfg and autoexec.cfg, nothing is overriding the cvar unless there's a stock config I'm unaware of.
You got some options to hunt this down:

Try to rename addons folder and restart server. If something in MMS or SM is changeing the Var you will know for sure, if it is unchanged after renaming. If it still changes without MMS and SM enabled the "changer" is in cfg folder somewhere

Enable Addons back and try to change maxplayers "on the fly" via sm_recon and see what happens (errorlogs consoleoutput etc)

Disable all Plugins and enable each one after changing sv_visiblemaxplayers. If it gets overwritten by a plugin this is the way to find it. You can spare Stockplugins from SM btw

Had something similar with a bots plugin a few years ago, was very frustrating to find that. Good Luck
__________________
micazoid 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 10:30.


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