How can I limit each team to have 5 players each and have 2 spectators in my CSGO server?

Solution 1:

Take your config and edit the following lines to your needs:

`mp_spectators_max "2" // How many spectators are allowed in a match.`

`maxplayers "10"`

and you could try this as bonus to make it "competitive"

sv_competitive_official_5v5 "0" // Enable to force the server to show 5v5 scoreboards and allows spectators to see characters through walls.

If you need anything else, here is a link with 2483 console commands (not sure if that are all available commands but definitely all you'll ever need)

Update:

So that the commands dont work I just found that there is a -maxplayers_override command but i dont know if this still works. However there is an entry on the Valve Dev Page about this problem which you could try. I just found another comment in the steam forum which seems to be important.

The maxplayers command must be above the convars segment. Put that maxplayer into the gamemode part you are trying to change.

You have to write the following in the gamemodes/gamemodes_server.txt

 "GameModes_Server.txt"
 {
   "gameTypes"
   {
     "classic"
     {
       "gameModes"
       {
         "competitive"
         {
           maxplayers      "6"
         }
       }
     }
   }
 }