AlliedModders (
-   Approved Plugins (
-   -   NextMap with Sven Co-op Fix (

AdamR 11-27-2007 14:36

NextMap with Sven Co-op Fix
2 Attachment(s)

I've spent a lot of time modifying the original nextmap plugin, and fixed it to work with Sven Co-op map cycles.

The differences are mainly to only increment the map cycle position when the map at the current position is being played, so map series do not cause maps in the cycle to get skipped. It also allows the nextmap cvar that some maps decide to use work, and still not skip maps.

I've commented around stuff I've added/changed.

Worth mentioning: I have not designed or tested this plugin in any other game than Sven Co-op. Although it may appear to work, I highly recommend you do not use it on a live public or private server for any other game than Sven Co-op.


Ensure you comment out the original nextmap.amxx in your plugins.ini. Place my nextmap_sven.amxx in the same plugins folder (or anywhere you want really) and add a new line for nextmap_sven.amxx underneath the commented out nextmap.amxx line.

I do not recommend you overwrite the original nextmap.amxx in case you have problems with this modified one. However, you can set amx_nextmap_svenfix to 0 to disable my modifications without having to load the original plugin. It is 1 by default, you do not need to specify that to any configuration file.

If you want to use the new feature that will randomize selections through your map cycle, you also need to define CVAR amx_nextmap_random with value 1. This feature is disabled by default to prevent confusion for those of you updating blindly. If you are going to use this feature then you should also have a large map cycle to go with it for best results. (really, 50+ maps) This will greatly improve the fresh/unpredicted experience your players will get.

Please let me know if this plugin works properly on your server. I suggest you test it out with map series, keeping note of your cycle. Some test procedures and an overview of the original problem can be found here.


  • Added functionality to send the next map to player score boards (for Sven Co-op 4.5 and later).
  • Also changed CVAR's to pointer CVAR's.

Sorry for the long publish delay...
  • New feature: Option to choose a next map at random, instead of progress through the cycle in a linear fashion.
    The currently and previously played map from the cycle (oh yes, taking into account Sven Co-op multimaps) are excluded from selection.
    This feature requires 3+ maps in the cycle, and is disabled by default to prevent confusion. Set CVAR "amx_nextmap_random" to 1 to enable this feature.
  • New feature: Command to choose a new map "amx_nextmap_choose [map]".
    Using this command will let you specify the next map manually, or if the parameter is left blank choose one from the cycle at random. Doing so via this command will also update the next map on the scoreboard.
    Default access is ADMIN_MAP.
  • New feature: The map being loaded is now shown when the intermission scoreboard appears.
Back-end changes of which won't be noticed by players:
  • Added more comments so other people can see what's going on more.
  • Cleaned up log/console outputs.
  • Made more use of pointer CVAR's.
  • Moved a lot of common functionality into re-usable functions.
  • More meaningful variable names.

iggy_bus 11-28-2007 17:14

Re: NextMap with Sven Co-op Fix
I have a question.

In original nexmap there is one thing that I hate.

For example, if current map is de_cbble, and next two maps in mapcycle.txt are de_aztec, de_dust2...and admin comes on the current map (de_cbble) and gives vote for de_dust2, and it passes, he accepts and changes to de_dust2 that has been voted, then nexmap is again de_dust2 because it was in mapcycle.txt

Is this fixed in your modification so the real next map (in my example de_aztec) would not be skipped if there has been a vote accepted?

AdamR 11-28-2007 17:50

Re: NextMap with Sven Co-op Fix
Yes, in theory, my modification would notice that aztec isn't being played so it would hold the map cycle position until it is played.

Remember: I have not designed or tested this for any other game than Sven Co-op, therefore I do not recommend using this plugin in a live public/private server for any other game.

AdamR 01-16-2008 15:09

Re: NextMap with Sven Co-op Fix
I've just noticed this plugin has been approved. Thank you Zenith77 :)

Nomble 03-09-2008 14:50

Re: NextMap with Sven Co-op Fix
Hello, I'm still having problems with the nextmap. Right now when I type in the console "nextmap" it says the correct nextmap. But when I type it in chat it says wrong and it still changes to the wrong one!

AdamR 03-09-2008 19:27

Re: NextMap with Sven Co-op Fix
If a map calls a new map via the game_changelevel entity, this plugin has no control over that. It can only remember that the next map that should have been played will still show as next, and be run when possible.

cartman-2000 04-23-2008 23:43

Re: NextMap with Sven Co-op Fix
This doesn't work on some maps, afrikakorps1 for example, it still goes to the next map in the mapcycle and not the next one in the series. The thing I've noticed is the the map config (that has the nextmap cmd for afrikakorps2) gets executed before this mod does. so this mod still sets the nextmap to what it's not suppost to be set to. Is it posible to add code to the mod to reexecute the maps cfg file after this mod is done on map start.

AdamR 04-24-2008 05:55

Re: NextMap with Sven Co-op Fix
No idea why, it's executing at the right time for me. You might need a plugin to execute the map config file again.

cartman-2000 04-24-2008 18:18

Re: NextMap with Sven Co-op Fix
can't find one that does only that. But would adding something like this to the end of plugin_init in this plugin fix this?

server_cmd("exec maps/%s.cfg", g_currentMap);

seems to work fine.

[edit again]
actually, it doesn't work if you put deagles map management plugin on the server, that plugin sets the map at the start of the map too.

by putting this line into the end of plugin_init

set_task(6.0, "execmapcfg")

and moving the server_cmd line in this post into it's own function will fix this.

public execmapcfg()
server_cmd("exec maps/%s.cfg", g_currentMap);


cartman-2000 04-28-2008 22:04

Re: NextMap with Sven Co-op Fix
Would it be possible to have a random nextmap, instead of having a sequential nextmap. I'm in the process of adding maps to my server and the mapcycle position usually gets reset before it reaches the end, so the maps at the end of the mapcycle rarely get played and the ones in the beginning of the mapcycle get played to much.

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

Powered by vBulletin®
Copyright ©2000 - 2020, vBulletin Solutions, Inc.