Raised This Month: $32 Target: $400
 8% 

[CS:GO] Show The Right Next Map - v1.0.1 updated 9/8/2012


Post New Thread Reply   
 
Thread Tools Display Modes
Author
PharaohsPaw
Senior Member
Join Date: Dec 2008
Plugin ID:
3220
Plugin Version:
1.0.1
Plugin Category:
General Purpose
Plugin Game:
Counter-Strike: GO
Plugin Dependencies:
    Servers with this Plugin:
     
    Plugin Description:
    Replace CS:GO's end of map chat msg with what SM says the next map will be
    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 - 9131 views - 3.3 KB)

    Last edited by Sheepdude; 01-26-2013 at 00:54. Reason: 1.0.2 update
    PharaohsPaw is offline
    pedroza26
    Junior Member
    Join Date: Sep 2012
    Location: Kraków, Poland
    Old 09-07-2012 , 05:36   Re: [CS:GO] Show The Right Next Map - posted 9/6/2012
    Reply With Quote #2

    wooow
    It's great !!

    +for you
    __________________
    My CSGO servers :
    [CLASSIC COMPETITIVE]

    [ARMSRACE GUNGAME]
    pedroza26 is offline
    PlasteR
    Senior Member
    Join Date: May 2011
    Location: Poland
    Old 09-07-2012 , 06:54   Re: [CS:GO] Show The Right Next Map - posted 9/6/2012
    Reply With Quote #3

    Good work Thx )
    __________________
    PlasteR is offline
    KawMAN
    SourceMod Donor
    Join Date: Sep 2007
    Location: Cracov
    Old 09-07-2012 , 11:20   Re: [CS:GO] Show The Right Next Map - posted 9/6/2012
    Reply With Quote #4

    You don't need that line
    PHP Code:
    new Handle:csgo_strnm_version INVALID_HANDLE
    Maybe would be better to force keep sync between nextlevel and sm_nextmap cvars
    __________________
    KawMAN is offline
    Send a message via ICQ to KawMAN Send a message via Skype™ to KawMAN
    jholland
    Member
    Join Date: Sep 2012
    Location: Minnesota
    Old 09-07-2012 , 13:15   Re: [CS:GO] Show The Right Next Map - posted 9/6/2012
    Reply With Quote #5

    Installed today, seems to be doing exactly what it's supposed to.

    Thanks
    __________________
    jholland is offline
    PharaohsPaw
    Senior Member
    Join Date: Dec 2008
    Old 09-07-2012 , 13:40   Re: [CS:GO] Show The Right Next Map - posted 9/6/2012
    Reply With Quote #6

    Quote:
    Originally Posted by KawMAN View Post
    You don't need that line
    PHP Code:
    new Handle:csgo_strnm_version INVALID_HANDLE
    Interesting, I'll try it out. Maybe nixing that would get rid of the compile warning.

    Quote:
    Originally Posted by KawMAN View Post
    Maybe would be better to force keep sync between nextlevel and sm_nextmap cvars
    Maybe, but could also become a lot more complex than this really needs to be. Besides, if later on down the road SM is able to set the server's nextlevel, a plugin won't be necessary to do that, whereas with what this plugin does now, it might still be useful later if you just want a different looking next map message.
    PharaohsPaw is offline
    Powerlord
    AlliedModders Donor
    Join Date: Jun 2008
    Location: Seduce Me!
    Old 09-07-2012 , 13:46   Re: [CS:GO] Show The Right Next Map - posted 9/6/2012
    Reply With Quote #7

    Quote:
    Originally Posted by KawMAN View Post
    You don't need that line
    PHP Code:
    new Handle:csgo_strnm_version INVALID_HANDLE
    Maybe would be better to force keep sync between nextlevel and sm_nextmap cvars
    I heard the SourceMod devs tried that and it caused problems.

    Besides, isn't it the nextmap cvar, not nextlevel cvar?
    __________________
    Not currently working on SourceMod plugin development.
    Powerlord is offline
    KawMAN
    SourceMod Donor
    Join Date: Sep 2007
    Location: Cracov
    Old 09-07-2012 , 13:54   Re: [CS:GO] Show The Right Next Map - posted 9/6/2012
    Reply With Quote #8

    there is nextmap command and nextlevel cvar, i tested nextlevel cvar and i didn't notice any problems, of course i tested it without SM plugins: nextmap,mapchooser as they are changing map before engine.

    maybe you heard about nextmap cmd, not nextlevel cvar.
    __________________

    Last edited by KawMAN; 09-07-2012 at 13:58.
    KawMAN is offline
    Send a message via ICQ to KawMAN Send a message via Skype™ to KawMAN
    PharaohsPaw
    Senior Member
    Join Date: Dec 2008
    Old 09-07-2012 , 15:19   Re: [CS:GO] Show The Right Next Map - posted 9/6/2012
    Reply With Quote #9

    Well, "nextmap" is a sourcemod command. There does appear to be a hidden "nextlevel" CVAR in CS:GO. I don't know if it works or not, but once again, this plugin is just a simple plugin. I'm not interested in having it try to manipulate the server engine's next map value, especially if SM itself is going to be doing that all by itself at some point in the future.

    I have read (and participated in some of) the discussions about SourceMod hopefully setting the engine's next map at some point in the future. There is an open bug/RFE on this as well. As Psychonic said somewhere here on the forums, CS:GO isn't even officially supported yet for SM and we don't need to jump the gun.

    As I said in the plugin description, once that happens, this plugin probably won't even be needed anymore anyway.

    This plugin only needs to do one thing: intercept the message the server wants to print at map end (that will have the wrong map name if SM has changed what the next map will be) and replace it with a message that has the right map name. (where 'right' = the map SM is about to change the map to).

    It works.

    If folks want something more complex, knock yourselves out -- it's open source. But please do it in your own plugin thread.

    Last edited by PharaohsPaw; 09-07-2012 at 15:24.
    PharaohsPaw is offline
    Powerlord
    AlliedModders Donor
    Join Date: Jun 2008
    Location: Seduce Me!
    Old 09-07-2012 , 15:31   Re: [CS:GO] Show The Right Next Map - posted 9/6/2012
    Reply With Quote #10

    Quote:
    Originally Posted by PharaohsPaw View Post
    Well, "nextmap" is a sourcemod command. There does appear to be a hidden "nextlevel" CVAR in CS:GO. I don't know if it works or not, but once again, this plugin is just a simple plugin. I'm not interested in having it try to manipulate the server engine's next map value, especially if SM itself is going to be doing that all by itself at some point in the future.
    You're correct, I was misremembering. I don't really deal with CS:GO much, just TF2... which does have a nextlevel cvar. However, I think its own map voting system refers to it as nextmap in the server console log, which is probably why I got confused.

    Quote:
    Originally Posted by PharaohsPaw View Post
    There is an open bug/RFE on this as well. As Psychonic said somewhere here on the forums, CS:GO isn't even officially supported yet for SM and we don't need to jump the gun.
    You mean this bug? I filed that one back in January of this year... although, I had the wrong cvar name in it up until a few minutes ago...
    __________________
    Not currently working on SourceMod plugin development.

    Last edited by Powerlord; 09-07-2012 at 15:33.
    Powerlord is offline
    Reply



    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 23:24.


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