Raised This Month: $51 Target: $400
 12% 

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
Potato Uno
Veteran Member
Join Date: Jan 2014
Location: Atlanta, Georgia
Old 07-08-2015 , 18:53   Re: sv_visiblemaxplayers not working in server.cfg
Reply With Quote #10

Did that print statement get printed on the server console? If not, then the plugin didn't run properly.

If it did, uncomment the ServerCommand() part and try again.
Potato Uno 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 17:06.


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