Index: src/game/g_main.c =================================================================== --- src/game/g_main.c (revision 872) +++ src/game/g_main.c (working copy) @@ -145,7 +145,7 @@ // latched vars { &g_maxclients, "sv_maxclients", "8", CVAR_SERVERINFO | CVAR_LATCH | CVAR_ARCHIVE, 0, qfalse }, - { &g_maxGameClients, "g_maxGameClients", "0", CVAR_SERVERINFO | CVAR_LATCH | CVAR_ARCHIVE, 0, qfalse }, + { &g_maxGameClients, "g_maxGameClients", "0", CVAR_SERVERINFO | CVAR_ARCHIVE | CVAR_NORESTART, 0, qtrue }, // change anytime vars { &g_timelimit, "timelimit", "0", CVAR_SERVERINFO | CVAR_ARCHIVE | CVAR_NORESTART, 0, qtrue }, Index: src/game/g_cmds.c =================================================================== --- src/game/g_cmds.c (revision 872) +++ src/game/g_cmds.c (working copy) @@ -666,6 +666,15 @@ if( !Q_stricmp( s, "spectate" ) ) team = PTE_NONE; + else if( !force && ent->client->pers.teamSelection == PTE_NONE && + g_maxGameClients.integer && level.numPlayingClients >= + g_maxGameClients.integer ) + { + trap_SendServerCommand( ent - g_entities, va( "print \"The maximum number " + "of playing clients has been reached (g_maxGameClients = %i)\n\"", + g_maxGameClients.integer ) ); + return; + } else if( !Q_stricmp( s, "aliens" ) ) { if( level.alienTeamLocked )