How to change the loaded map and config files on a rented Counter Strike: Global Offensive server

counter-strike-global-offensiveserver-administrationsource-engine

I just rented a fresh game server, and performed my initial setup.

The server is loading de_dust on startup, and I would like it to load de_nuke. I would then like it to load the ESL config. I tried to resolve the problem by adding

exec esl.cfg
changelevel "de_dust2" 

into the server.cfg, but it seems like the server is not executing these commands.

Have I done it incorrectly, or am I best to contact the server admin?

Best Answer

You're editing the wrong file. Counter Strike Global Offensive (CS:GO) is working in other way than source do.

Exec cfg

To make the server exec you esl.cfg you've to add your exec command to the autoexec.cfg

Mapcycle

There is gamemodes.txt file around which you've to override and to do so you've to make a gamemodes_server.txt which looks like this (standard format in CS:GO)

// Values here override the default gamemodes.txt 

"GameModes_Server.txt"
{
    "gameTypes"
    {
        "classic"
        {
            "gameModes"
            {
                "casual"
                {
                    "convars"
                    {
                        "sv_allow_votes"                    "0"
                        "mp_roundtime"                      "4"
                        "add cvars here"                    "or under mode u want to run"
                    }

                    "mapgroupsMP"                       // List of mapgroups valid for this game mode
                    {
                        "mg_bomb"       ""
                        "mg_hostage"        ""
                        "mg_dust"       ""
                    }
                }

                "competitive"
                {
                    "convars"
                    {
                        "mp_startmoney"                         "800"
                        "mp_maxmoney"                           "16000"
                        "mp_match_end_restart"                  "0"
                        "add other cvars u want"                "under gamemod u want to run"
                    }

the point here are those lines:

"mapgroupsMP"
{
    "mg_bomb"       ""
    "mg_hostage"    ""
    "mg_dust"       ""
}

In such mapgroups you can fill in maps and map cycles like the mapcycle.txt back in Source.

To create such a mapgroup you've to do the following:

//////////////////////////////////////////////////////////////////////////////////////////////
// Map groups
//
// To use a mapgroup, it needs to be defined in a keyvalues
// block such as the example below, as well as listed in the 
// 'mapgroupsMP' block within the game mode that will run it,
// such as the example above.
//
// Then launch the server with '+mapgroup MAPGROUPNAME'
//
// Example:
//
// srcds -game csgo +game_mode 1 +mapgroup mg_bomb_se +map de_nuke_se
//
//
// Check the developer wiki for updated community info
// https://developer.valvesoftware.com/wiki/Counter-Strike:_Global_Offensive_Dedicated_Servers
//////////////////////////////////////////////////////////////////////////////////////////////


    "mapgroups"
    {
        "mg_custom"                                 // mapgroup definition
        {
            "name"          "mg_custom"
            "maps"
            {
                "de_dust"       ""
                "de_aztec"      ""
                "cs_italy"      ""
                "de_dust2"      ""
                "de_train"      ""
                "cs_office"     ""
                "de_inferno"        ""
                "de_nuke"       ""
                "cs_estate"     ""
            }
        }
    }
}

Now you can use the server startcommand like +mapgroup mg_custom +map de_dust2 to start your own mapcycle.

Important!

You could just edit the gamemode.txt but those changes will be resetted as soon as you get an update.

If you need more help, you'll find some on Valves Developer Community page.