For Insurgency 2014 game.
This game can use different gamemodes in one same map (depends how map is created).
So I tried create this plugin+natives to get more control to handle maps with different gamemodes.
Plugin try search all maps cpsetup script files and save gamemodes inside of those to own KeyValue tree.
Maps which not have this txt file (or file have zip inside map) will not get stored into KeyValues tree.
To do
Use https://developer.valvesoftware.com/wiki/BSPSource (or else) to decompile map.
There is bat file called bspinfo.bat, use that to extract cspsetup file inside map.bsp.
Its same name as map, ex. ghazni.txt
And place txt file in same place where map is.
You can use server command to dump all legacy workshop maps in maps/workshop/workshop_maps.txt
sm_dump_workshop_maps
Add your workshop map list
Edit ...addons/sourcemod/configs/maplists.cfg
Code:
/**
* Use this file to configure map lists.
*
* Each section is a map list that plugins can use. For example, the Admin Menu
* requests an "admin menu" map list, and you can control which maps appear via
* this file.
*
* Each section must have a property that explains where to read the maps from.
* There are two properties:
*
* target - Redirect the request to another section.
* file - Read a file of map names, in mapcycle.txt format.
*
* There is one section by default, called "mapcyclefile" - it is mapped to the
* mapcycle.txt file, or whatever the contents of your mapcyclefile cvar is.
*
* If a plugin requests a map list file which doesn't exist, or is empty, SourceMod
* tries the "default" section, and then the "mapcyclefile" section.
*/
"MapLists"
{
/**
* Default requests go right to the mapcyclefile.
*/
"default"
{
"target" "mapcyclefile"
}
"insurgency_maps plugin workshop"
{
"file" "maps/workshop/workshop_maps.txt"
}
"sm_map menu"
{
"target" "default"
}
/* Admin menu, map voting menu */
"sm_votemap menu"
{
"target" "default"
}
/* For the "randomcycle" plugin */
"randomcycle"
{
"target" "default"
}
/* For the "mapchooser" plugin */
"mapchooser"
{
"target" "default"
}
/* For the "nominations" plugin */
"nominations"
{
"target" "default"
}
}