View Single Post
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 04-23-2011 , 13:41   Re: A quick and hopefully easy question
Reply With Quote #2

Code:
       "Set next map"
       {
              "cmd"      "sm_setnextmap @1"
              "admin"    "sm_kick"
              "execute"  "server"
              "1"
              {
                    "type"           "mapcycle"
                    "path"           "maplist.txt"
                    "title"          "set the next map"
              }
       }


*edit
I want tell little about SM maplist.cfg. Not need do this (or read).

- It's maybe better leave "default" to "mapcyclefile", this follow srcds cvar
Code:
"mapcyclefile" = "mapcycle.txt"
 game
 - Name of the .txt file used to cycle the maps on multiplayer servers
Using this cvar you can change server mapcycle file.
mapcyclefile "myfunnymaps.txt"


So this list ...addons/sourcemod/configs/maplists.cfg
SM plugins where have built using this
ReadMapList
works on that list.

Like now there is
sm_map menu = basecommands.smx
sm_votemap menu = basevotes.smx
randomcycle.smx
mapchooser.smx
nominations.smx

What @spacedkadet tried to do was simple command, sm_setnextmap
It not use SM maplists.cfg, but with adminmenu_custom.txt you can list maps on menu, what I have show above.
From current mapcyclefile or specific path/file.
Code:
                    "type"           "mapcycle"
                    "path"           "maplist.txt" // With this or without
-------------------------------------------- line break

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"
    }
    
    /* Admin menu, map menu */
    "sm_map menu"
    {
        "file"            "addons/sourcemod/configs/adminmenu_maplist.ini"
    }
    
    /* Admin menu, map voting menu */
    "sm_votemap menu"
    {
        "file"            "maplist.txt"
    }
    
    /* For the "randomcycle" plugin */
    "randomcycle"
    {
        "target"        "default"
    }
    
    /* For the "mapchooser" plugin */
    "mapchooser"
    {
        "target"        "default"
    }
    
    /* For the "nominations" plugin */
    "nominations"
    {
        "target"        "sm_votemap menu"
    }
}
- Want to show also quickly example, how you can change plugins to use different maplist if need.

Marked with red follows server mapcyclefile, this is file what you have set on server. By default it is mapcycle.txt
This now is "default" and plugins (randomcycle, mapchooser) have target in this and start use mapcyclefile.

Marked with blue follow maplist.txt.
I have change plugin (sm_votemap menu) to look file maplist.txt,
then I have also change (nominations) to target (sm_votemap menu) what start suprise suprise, look maplist.txt

And last that (sm_map menu) what try read file if exist
addons/sourcemod/configs/adminmenu_maplist.ini
otherwise it's "default"
If "default" have change to other and also doesn't exist, then use final mapcycle

Last edited by Bacardi; 04-23-2011 at 14:58.
Bacardi is offline