Raised This Month: $94 Target: $400
 23% 

FB-Mapchanger (force mapchange for round based games)


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   Natural Selection        Category:   Server Management        Approver:   Hawk552 (427)
Unsichtbar
Member
Join Date: Oct 2007
Old 08-06-2009 , 06:37   FB-Mapchanger (force mapchange for round based games)
Reply With Quote #1

Here is a small plugin i wrote this morning for our Natural Selection server to prevent never ending bot-only games on the same map over hours. This plugin is really simple but i was unable to find one that can do that trick.

Code:
/* 
 * Unsichtbar's
 * FB-Mapchanger AmxModx Plugin
 *
 * This plugin forces a mapchange to "nextmap" if amx_timeleft
 * runs out and no human players are on your server.
 * Plugin was made and tested for Natural Selection but can be
 * of use for any round based mods.
 *
 * Bots on a Natural Selection server fight over hours on the
 * same map and the server will crash sooner then later.
 * To prevent never ending bot games i wrote this little plugin.
 *
 * Fire-Bursts.com Gaming Network
 * 
 */
Options / Server CVAR
fb_humans (default 0)
Set amount of human players the server will ignor to change the map. Example: if fb_humans is set to 4 then the server will need at least 5 human players or a mapchange will be forced.

Changelog
Version 1.4
  • Better check for human players including connection and hltv
  • Added fb_humans cvar to set human player amount the server will ignor for a mapchange.
Version 1.3
  • Added valid map check for nextmap
  • Added log text if nextmap is invalid
  • Moved get amx_nextmap from plugin_init to right before the changelevel server command
Attached Files
File Type: sma Get Plugin or Get Source (changemap.sma - 1112 views - 1.6 KB)
__________________


Last edited by Unsichtbar; 08-11-2009 at 11:17. Reason: Update 1.4
Unsichtbar is offline
crazyeffect
Veteran Member
Join Date: Jul 2008
Location: Belgium
Old 08-06-2009 , 06:43   Re: FB-Mapchanger (force mapchange for round based games)
Reply With Quote #2

So its just that the map changes when there are only bots online?

I see a good point at this, because when its a boring map, only bots play,

When the map changes, and its a popular map, people will come!

Good Job
__________________
crazyeffect is offline
Send a message via MSN to crazyeffect
Nextra
Veteran Member
Join Date: Apr 2008
Location: Germany
Old 08-06-2009 , 10:06   Re: FB-Mapchanger (force mapchange for round based games)
Reply With Quote #3

Nice little thing, should be useful for NS server owners according to your description. Just some minimal things:

Just correcting you on that "bugfix", these expressions do not differ in functionality, there is no problem if you return to the old way of doing it:
PHP Code:
humans humans++ 
PHP Code:
humans++ 
I'd say you should get the nextmap directly before changing the map and check if it is a valid map. It's not guaranteed that amx_nextmap is properly set on plugin_init.
__________________
In Flames we trust!
Nextra is offline
Unsichtbar
Member
Join Date: Oct 2007
Old 08-06-2009 , 11:40   Re: FB-Mapchanger (force mapchange for round based games)
Reply With Quote #4

Thanks for your nice words and help. I did my last amx plugin about 3 years ago so it may not be that smart code at all. I added the suggestions to the code in v1.3.
__________________


Last edited by Unsichtbar; 08-12-2009 at 07:06.
Unsichtbar is offline
meigyoku
BANNED
Join Date: Apr 2009
Old 08-07-2009 , 10:04   Re: FB-Mapchanger (force mapchange for round based games)
Reply With Quote #5

Sorry my english but can you explain this plugin: if amx_timeleft runs out
meigyoku is offline
Unsichtbar
Member
Join Date: Oct 2007
Old 08-08-2009 , 08:20   Re: FB-Mapchanger (force mapchange for round based games)
Reply With Quote #6

amx_timeleft is the amount of time that is left to play on a map before the server changes it to the nextmap in cycle. Not so in round based games like Natural Selection, the server won't change the map until the round is over even when the predefined timelimit is over / no time left. But there is no point in having bots on your server playing a round for hours as long as the server does not crash, Natural Selection is not known as a very stable mod so the server will crash - it is just a question how much time it will take. To prevent that from happening i just come up with that plugin that checks if the players on the server are humans or bots and if there are only bots on the server and no human players the map will be forced to change to the next map in cycle even when the round is not over.
__________________


Last edited by Unsichtbar; 08-08-2009 at 08:22.
Unsichtbar is offline
meigyoku
BANNED
Join Date: Apr 2009
Old 08-10-2009 , 16:27   Re: FB-Mapchanger (force mapchange for round based games)
Reply With Quote #7

Thank, can you make a - immunity admin. If have spectator immunity admin, and all of bots, it will change map
Can you make if have only <= 4 - from 4 and less (for example) players in the map (not include bots) and playing about 10 minute, it will change map? (boring map)?
meigyoku is offline
Unsichtbar
Member
Join Date: Oct 2007
Old 08-11-2009 , 11:16   Re: FB-Mapchanger (force mapchange for round based games)
Reply With Quote #8

No problemo ;)

Added in v1.4 the cvar "fb_humans" so you can set an amount of human players the server will ignor. I found that a nice idea because if just one or maybe two players a blocking a map, maybe idle players the plugin won't change the map. Now the map will be changed if the fb_humans amount is set.
__________________

Unsichtbar is offline
alexinno
Senior Member
Join Date: Mar 2007
Location: C:\
Old 08-11-2009 , 15:06   Re: FB-Mapchanger (force mapchange for round based games)
Reply With Quote #9

can you take a look at my request here and tell me if you could make it happen with this plugin ?
__________________

[IMG]http://img188.**************/img188/5787/banner2rcw.png[/IMG]
alexinno is offline
Unsichtbar
Member
Join Date: Oct 2007
Old 08-12-2009 , 07:09   Re: FB-Mapchanger (force mapchange for round based games)
Reply With Quote #10

Well i'm not exactly sure if i know what you want. If you just want to add a mapvote before you could use in combination the amxmodx's mapchooser plugin because it will set the amx_nextmap after the vote and my plugins will use this map. If you want a plugin that never changes a map and continue the same map over and over as long as the players won't drop uder a predefined limit then this plugin won't work for you i guess.
__________________

Unsichtbar is offline
Reply


Thread Tools
Display Modes

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 02:13.


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