Raised This Month: $12 Target: $400
 3% 

A quick and hopefully easy question


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
spacedkadet
Member
Join Date: May 2008
Old 04-23-2011 , 07:22   A quick and hopefully easy question
Reply With Quote #1

Hi all,

Ive managed to add an option to the servercommands menu for setting the next map, however when using it it just chooses from the mapcycle not maplist.txt.
In the maplists.cfg I have every entry set to this:
"file" "maplist.txt"

Every other plugin and map choice reads from my maplist apart from this one?

So my question is=
When adding a menu item to the server command section via the adminmenu_custom file how do i get it to read maplist.txt, do i need to add an entry into maplists.cfg?

Many thanks. Lee.

Oh and you can see my 2 relevant configs :
http://spacedkadet.com/files/maplists.cfg
http://spacedkadet.com/files/adminmenu_custom.txt
spacedkadet is offline
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
spacedkadet
Member
Join Date: May 2008
Old 04-23-2011 , 20:32   Re: A quick and hopefully easy question
Reply With Quote #3

thankyou bacardi, the original way worked fine, i added the path maplist.txt and that worked fine. This would be a nice function to have as default though tbh. having change map (immediatly) is great but also having setnextmap is (for our clan) more important and would be nice to be default.

It was a simple thing i wanted to do but was quite complicated to setup!

Last edited by spacedkadet; 04-23-2011 at 20:34.
spacedkadet is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 07:00.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode