After downloading countless maps and updating the maplist the same amount, I wondered why it wasn't an automated process. Well, instead of complaining, I went ahead and made this plugin.
What it does is fill maplist.txt with every map (.bsp file) in your maps/ directory whenever you execute "sm_writemaplist" from the console of an admin. Also, if you execute "sm_maplist" from any console, it will reply with the maplist from maps/. Using the cvar sm_auto_maplist, you can let it generate a new maplist whenever the map changes.
ConCommands:
- sm_maplist [filter]
- Prints a map list satisfying the optionally specified filter to the user that executed the command.
- sm_writemaplist <output file> [filter]
- Outputs a map list satisfying the optionally specified filter to the file specified. This requires the generic admin flag ('b').
ConVars:
- sm_maplister_version
- The version of the maplister plugin
- sm_auto_maplist
- (0|1) Will automatically generate a new maplist when the map changes or the server starts.
Installation:- With .smx
- Use the "Get Plugin" link to download the .smx. Place it in the addons/sourcemod/plugins directory
Changelog:
- Version 1.0
- Version 1.1
- Can use writemaplist from the user console. It will check that the user is an admin. It turns out that GetUserAdmin() wasn't working for me because it didn't work on Windows Listen servers. They fixed it in 938+, so I updated the code and tested it.
- Version 1.2
- Updated to plugin standards
- Added version cvar
- Renamed all commands to the sm_ prefix
- Commented and formatted code
- Added natives (Available in the .zip or .rar packages)
- WriteNewMaplist
- ListMapsToClient
- Version 1.3
- Restyled code
- Allowed filenames to be used in sm_writemaplist:
- sm_writemaplist <filename>
- Map lists are now sorted alphabetically A-Z
- Version 1.4
- Map exclusion file (configs/maplister_excludes.cfg) allows you to specify maps that should be excluded when listing maps (to players and files).
- Put one map name on each line in sourcemod/configs/maplister_excludes.cfg
- Exclude the ending ".bsp"
- Version 1.5
- Map name filters allow you to print only the maps that start with the specified string. For example, `sm_maplist cs` will list only the maps that began with the letters "cs": cs_assault, cs_compound, cs_crackhouse, etc.
- Fixed the maps exclusion file. The problem was that I would loop through all the lines in the file for the first map name, and I never reset the file pointer. It would be stuck at the bottom the whole time.
- Version 1.6
- Added support for L4D add-on maps.
- Version 1.6.8 (by Malachi -- he's awesome)
- All configuration resides in configs/maplister.cfg (first line denotes the filename Maplister outputs to when writing to file)
- SteamPipe support
If you have any comments or suggestions, please tell me!