View Single Post
Author Message
PharaohsPaw
Senior Member
Join Date: Dec 2008
Old 09-06-2012 , 23:26   [CS:GO] Show The Right Next Map - v1.0.1 updated 9/8/2012
Reply With Quote #1

NOTE: Post 23 January 2013, a new protobuf version of this plugin is required.

Description
This is a simple plugin for CS:GO which hooks and intercepts the Next Map: *blah* message that CS:GO servers always print to chat at map end, and replaces it with a message indicating the CORRECT next map - ie, what SourceMod says the next map is going to be (and what will actually get loaded next).

This is useful to avoid "mass confusion" (LOL) among your players if you're using SM-based map voting on your CS:GO server, or have otherwise used SM to set the next map to something else -- because without this plugin the stock Next Map: message at the end of the map will show the wrong map is coming next.

Why Do I Need This Plugin?
The CS:GO dedicated server engine (at least right now) *ALWAYS* bases its end-of-map Next Map: message on what's next in the mapcyclefile (yeah, the mapcyclefile -- not the defined mapgroup). A possible exception to that might be if you use Valve/CS:GO voting system to set the next map, but I wouldn't know. (we don't allow non-sourcemod-based voting on our servers).

If you never change/set the next map with SourceMod plugins (stock or otherwise), never use the sm_nextmap command to set the next map, and won't ever have sourcemod-based map voting, you probably don't need this plugin.

On the other hand, if you are thinking about using SourceMod map voting plugins, or otherwise want to use something in SourceMod to set the next map and can't figure out why that darn Next Map: chat message at map end STILL shows the wrong map even though the server changes to the "right" map (what SourceMod thinks will be next) - you should grab this plugin.

At some point SM will probably be able to set the CS:GO server's own nextmap value when an SM facility/plugin changes sm_nextmap, and nobody will need this plugin anymore -- unless you just like the fancier next map message. But until then, there is Show The Right Next Map.

PREREQUISITES
This plugin is not a substitute for having your server's +mapcyclefile (csgo/mapcycle.txt by default) and the +mapgroup the server is running set up with identical maps in the same order, and having the "default" target in SourceMod's sourcemod/configs/maplists.cfg pointing to the server's mapcyclefile cvar to keep everything in sync. You still need to do that. (in fact, you should do this even if you don't allow map voting...)

This post from the csgo_servers mailing list might be helpful and save me from re-typing it all:

http://www.mail-archive.com/csgo_ser.../msg03154.html


INSTALLATION
No config files, translations files, or anything else extra to worry about. Just drop the .smx file right into your sourcemod base directory's plugins/ directory, and load the plugin, restart the server, change the map, etc. so the the plugin loads. sm plugins load csgo_strnm.smx will work if you have the plugin in the correct directory and don't want to restart the server etc. The correct directory will be addons/sourcemod/plugins/ for most people.

CVAR's
This is a very simple plugin. I do not plan to code an 'enabled' / 'disabled' CVAR into it. You either need it, or you don't. Don't load it if you don't need it.

There is one public CVAR - csgo_strnm_version. It's purpose is to show the plugin version, and allow the "# of servers using this plugin" feature of the SM forums to work.

CREDITS
Psychonic - I'd like to thank Psychonic for providing the info on the TextMsg user message event to hook and the "#game_nextmap" data value to check the message for.

And misc. others who had posted examples of hooking and evaluating the contents of user message events.

CHANGELOG
1.0.0 - original release
1.0.1 - remove unnecessary Handle init for the public cvar, this fixed the compile warning in 1.0.0 (thanks to KawMAN for spotting that!). Also updated the plugin info structure with this forum thread URL.


MAINTENANCE / FEATURE REQUESTS / ETC
I probably won't be doing a lot else with this plugin. It's really, really simple what it does and I don't want to complicate it (nor do I really have time).

If you find a bug or discover a problem, etc. please post details, SM error logs, etc. here in this thread. I will not respond to PM's requesting support.
Attached Files
File Type: sp Get Plugin or Get Source (csgo_strnm.sp - 9133 views - 3.3 KB)

Last edited by Sheepdude; 01-26-2013 at 00:54. Reason: 1.0.2 update
PharaohsPaw is offline