How To Change Maxplayers On Source Engine Game Servers

In this guide, I will show you how to change the maxplayers on your SRCDS or Source Engine game server.

Set Maxplayers Via Command Line
This method actually hard-caps the maximum players limit in the Source Engine. Typically, I don’t suggest this because if you want to raise the maximum players, you will have to restart the server.

Standard Games
In standard Source Engine games (e.g. CS:S, TF2, and so on), you can use the following command line parameter.

sv_visiblemaxplayers <num>

This will make the server show as maxplayers in the server browser + everywhere else visibly. However, technically the server is still using the maxplayers set with the command line parameter. If a server hits the visible maxplayers, players won’t be able to join the server via the server browser or connecting off of friends. However, they will be able to connect to the server directly using the console command connect. This will make the server show at <visiblemax+x>/ (e.g. 47/46). On GameTracker (a server tracking website), it will just show as the server being full at 46/46.

Reserved Slots
This is the PREFERRED method. Using reserved slots allows only Supporters and VIPs+ (or anyone with the appropriate access) to join the server when full. The good thing about this is if you want to raise the visible maxplayers, you can just lower the reserved slots count which doesn’t require a server restart (which is why it’s recommended). Most reserved slot plugins actually make use of the sv_visiblemaxplayers ConVar (dynamic).

SourceMod
There’s a reserved slot plugin included in the default SourceMod installation. You may configure this in the cfg/sourcemod/sourcemod.cfg file. Here are the ConVars you may adjust to your needs:

// Specifies how the reserved slots plugin operates. Valid values are:
// 0 : Public slots are used in preference to reserved slots. Reserved slots are freed before public slots.
// 1 : If someone with reserve access joins into a reserved slot, the player with the highest latency and 
// no reserved slot access (spectator players are selected first) is kicked to make room. Thus, the reserved
// slots always remains free. The only situation where the reserved slot(s) can become properly occupied is 
// if the server is full with reserve slot access clients.
// 2 : The same as sm_reserve_type 1 except once a certain number of admins have been reached, the reserve slot
// stops kicking people and anyone can join to fill the server. You can use this to simulate having a large
// number of reserved slots with sm_reserve_type 0 but with only need to have 1 slot unavailable when there are
// less admins connected.
// --
// Requires: reservedslots.smx
// Default: 0
sm_reserve_type 0

// Specifies the number of reserved player slots.  Users with the reservation
// admin flag set will be able to join the server when there are no public slots
// remaining. If someone does not have this flag, they will be kicked.
// (Public slots are defined as: maxplayers - number of reserved slots)
// --
// Requires: reservedslots.smx
// Default: 0
sm_reserved_slots 0

// Specifies whether or not reserved slots will be hidden (subtracted from max
// slot count). Valid values are 0 (Visible) or 1 (Hidden).
// --
// Requires: reservedslots.smx
// Default: 0
sm_hide_slots 0

There are also custom reserved slot plugins that comes with more functionality.

Garry’s Mod
You can use ULX to set reserved slots in Garry’s Mod. You may configure these values in the data/ulx/config.txt file. Here are the ConVars you may adjust:

ulx rslotsMode 0 
ulx rslots 2 
ulx rslotsVisible 1 ; When this is 0, sv_visiblemaxplayers will be set to maxplayers - slots_currently_reserved
;Modes:
;0 - Off
;1 - Keep # of slots reserved for admins, admins fill slots.
;2 - Keep # of slots reserved for admins, admins don't fill slots, they'll be freed when a player leaves.
;3 - Always keep 1 slot open for admins, kick the user with the shortest connection time if an admin joins.

;Difference between 1 and 2:
;I realize it's a bit confusing, so here's an example.
;On mode 1--
;    You have maxplayers set to 10, rslots 2 
;    If a non-admin tries to join, they'll be kicked to keep the reserved slots open. Two admins join
;    and fill the two reserved slots. When non-admins leave, the two admins will still be filling the
;    two reserved slots, so another regular player can join and fill the server up again without being
;    kicked by the slots system

;On mode 2--
;    Same setup as mode 1, you have the two admins in the server and the server is full. Now, when a
;    non-admin leaves the server, reserved slots will pick up the slot again as reserved. If a regular
;    player tries to join and fill the server again, even though there are two admins connected, it will
;    kick the regular player to keep the slot open

;So, the basic difference between these two is mode 1 will subtract currently connected admins from the slot
;pool, while mode 2 while always be attempting to reclaim slots if it doesn't currently have enough when
;players leave no matter how many admins are connected.

;rslotsVisible:
;    If you set this variable to 0, ULX will automatically change sv_visiblemaxplayers for you so that if
;    there are no regular player slots available in your server, it will appear that the server is full.
;    The major downside to this is that admins can't connect to the server using the "find server" dialog
;    when it appears full. Instead, they have to go to console and use the command "connect <ip>".
;    NOTE THIS DOES NOT CHANGE YOUR MAXPLAYERS VARIABLE, ONLY HOW MANY MAXPLAYERS IT _LOOKS_ LIKE YOUR
;    SERVER HAS. YOU CAN NEVER, EVER HAVE MORE PLAYERS IN YOUR SERVER THAN THE MAXPLAYERS VARIABLE.