Okey dokie guys. I'm back from a very long 2 year hiatus of plugin making. So... yesterday I posted a request for someone to make me a plugin, no one filled it so I made it myself.
My programming skills in PAWN were a little rusty so I decided I would give it a shot. I apologize if something like this is already made, it was really for my specific server (even though it will work on anything and maybe people will like it) and also for me to polish my pawn skills. If someone already made something like this then I ask not to approve it, but if someone didn't by all means please
So without further adue, I present Easy Map rotation.
Here WAS my dilemma. I host svencoop servers, and if any of you know svencoop has two types of maps... horde and completable. Sometimes horde maps would have a time limit of 0 (meaning they would last til infinity) and some completable maps would have areas where only two players can get past. This really didn't make the map rotation smooth; I once had a map on my server for a full day because no body joined that day so nobody beat the map.
This plugin solves the problem. You can set your mp_timelimit to 0... why would you do this you might ask? Well because there is a new time limit... what I call the interval time. After set interval time the server will ask the players if they wish to continue on this map. If 50 percent or more of the people vote yes the map will stay and then ask on the next interval. If less than 50 percent OR NO ONE votes then it will switch. The key here is no one... so if no one is in your server the map will stay at most interval time.
A couple of commands and cvars which make this plugin unique:
amx_easymaprot_usingnextmap <1/0> : This may seem really complicated but its not. Essentially its asking if your using the AMXX nextmap plugin. If you are it won't repeat the next map. If you aren't then it will put the next map when you say next map.
say nextmap : This displays the next map and some information about the plugin.
say timeleft : This displays the timeleft and some information about the plugin
amx_easymaprot <1/0> : Enables/disables the plugin. If the plugin is disabled in the middle of an interval it will pick up where the interval left off when it is re-enabled. Think of this as a sort of pause.
amx_easymaprot_nextmap : will force the server to switch to the nextmap
amx_easymaprot_time : Sets the interval time dynamically. The new interval time will take affect after the current interval is counting down. Essentially it stores the new time in another variable until its ready to be applied.
amx_emr_enable <1/0> : Enable/disable the plugin
amx_emr_time x : Sets the interval time to x default is 15
amx_emr_usingnextmap <1/0> : read above
- You can use the core nextmap plugin if you wish, but make sure you define if you are or not in the cvars or commands
- It's not suggested you use the timeleft plugin since it says x mp_timeleft + whatever my plugin says. However, if you don't use the timeleft plugin you will loose that crazy speak number stuff so if enough people complain I will integrate that into this.
- The interval number must be an integer and is always in mins.
- I don't think amx_easymaprot_nextmap works. if anyone can help me find out why that would be awesome
- When you use the cvar to set a specific time you have to change the map directly after. I'm not sure why this happens either
Sorry. Example if you set the cvar to 30 in your server.cfg then start your server it will say time left is 15 mins (default) but once the server changes the level it will go to 30.
- 1.00 : Initial release.
- 1.01 : Fixes for dead players voting, pcvars, enable toggle
- 1.02 : Reverted 1.01 because it was crashing.
- 1.025 : Fixed check user error, includes dead players voting, pcvars and enable toggle
Any comments/suggestions/hatemail/love/etc feel free to share.
Catch ya on the flip side ganstas
PS. Like always my code is insanely commented and referenced. Good for new scripters to check out.