AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   General (https://forums.alliedmods.net/forumdisplay.php?f=58)
-   -   sv_visiblemaxplayers not working in server.cfg (https://forums.alliedmods.net/showthread.php?t=265889)

Marverlous 07-06-2015 21:05

sv_visiblemaxplayers not working in server.cfg
 
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.

Ade 07-07-2015 07:51

Re: sv_visiblemaxplayers not working in server.cfg
 
reserved slots present?

Marverlous 07-07-2015 11:27

Re: sv_visiblemaxplayers not working in server.cfg
 
Not at all.

Wilczek 07-07-2015 13:29

Re: sv_visiblemaxplayers not working in server.cfg
 
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.

Potato Uno 07-07-2015 14:02

Re: sv_visiblemaxplayers not working in server.cfg
 
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.

Marverlous 07-07-2015 14:18

Re: sv_visiblemaxplayers not working in server.cfg
 
If possible, would you share the mentioned plugin? That would be swell, appreciate it.

Potato Uno 07-07-2015 15:38

Re: sv_visiblemaxplayers not working in server.cfg
 
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.

Marverlous 07-07-2015 16:03

Re: sv_visiblemaxplayers not working in server.cfg
 
Thank you very much, I will test it right away.

Marverlous 07-08-2015 18:08

Re: sv_visiblemaxplayers not working in server.cfg
 
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.

Potato Uno 07-08-2015 18:53

Re: sv_visiblemaxplayers not working in server.cfg
 
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.

micazoid 07-10-2015 11:43

Re: sv_visiblemaxplayers not working in server.cfg
 
Quote:

Originally Posted by Marverlous (Post 2317365)
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

Dr_Knuckles 07-10-2015 14:08

Re: sv_visiblemaxplayers not working in server.cfg
 
It's something with this new update. All my 32 slot servers that I was using the hltv slot for a hidden 33rd slot are now only showing 31 slots. I can use sv_visiblemaxplayers to set it back to 32 but it just changes back a few seconds later.

Potato Uno 07-10-2015 14:11

Re: sv_visiblemaxplayers not working in server.cfg
 
PHP Code:

public OnGameFrame() // over-fucking-kill but it should work. Sets it once per game frame.
{
    
ServerCommand("sv_visiblemaxplayers 32");


PHP Code:

public OnPluginStart()
{
    
CreateTimer(1.0ChangeValue_TIMER_REPEAT);
}

public 
Action ChangeValue(Handle Timer// Sets it once a second.
{
    
ServerCommand("sv_visiblemaxplayers 32");


You can use either of these to forcefully set the convar every now and then, but they aren't good suggestions. Use at your own risk (worst thing that could happen is lag).

AllMassive 03-10-2021 03:07

Re: sv_visiblemaxplayers not working in server.cfg
 
Quote:

Originally Posted by Marverlous (Post 2317365)
The code compile without trouble, but visiblemaxplayers still remains unchanged for some reason
I checked both server.cfg and autoexec.cfg, nothing is overriding the cvar unless there's a stock config I'm unaware of.

Dont touch that
Code:

sv_visiblemaxplayers
and remove it from all configs.
Just set
Code:

+maxplayers
to the Value needed and then set
Code:

amx_hideslots
to the Number you want to substract from that
Code:

+maxplayers
.
Remeber: You only need one additional Slot!

If +maxplayers and sv_visiblemaxplayers differ, you will see the +maxplayer-Value - so you should just remove ANY sv_visiblemaxplayers-Setting in your configs and restart the hlds-process.


All times are GMT -4. The time now is 10:30.

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