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

[ANY] Auto Map Changer


Post New Thread Reply   
 
Thread Tools Display Modes
Author
Malachi
Senior Member
Join Date: Jun 2010
Location: USA
Plugin ID:
3473
Plugin Version:
0.1.6
Plugin Category:
Server Management
Plugin Game:
Any
Plugin Dependencies:
    Servers with this Plugin:
     
    Plugin Description:
    Changes empty server to a chosen map.
    Old 01-15-2013 , 19:36   [ANY] Auto Map Changer
    Reply With Quote #1

    Credits:
    This work is largely derived from Mleczam's Auto Change Map plugin which was more complicated than I needed and sometimes inadvertantly changed maps when people were on the server.
    Thanks to Mammal and http://www.necrophix.com/ for their support.

    How It Works:
    Every minute the plugin checks how many players are on the server. If the server is empty, it starts a 10 minute timer. If players return during this time, it goes back to checking how many players are on the server. If the server remains empty, the plugin changes the map to the one in the cvar (see below).

    Notes:
    The plugin is smart enough to not change the map when its already on the chosen map. It also checks to see if the map you set it to is valid. Right now it spams the server console with status msgs, and correctly logs when it performs a map change. The plugin doesn't care what the map time limit is set to. If a time limit changes the map, it should simply change it back. This was developed and tested on TF2, but like the work on which it was based should work for most anything.

    CVARS:
    sm_automapchanger_map <mapname> // Name of map to change to when server is empty, default=koth_nucleus

    Potential Future Enhancements:
    Set the default map based on which game the server is running.
    Remove the log spam and do away w/ the unneeded timestamps.
    Translations?
    Do we really need a cfg file for one cvar?
    Remove .bsp from map name? (how many ppl really need this?)
    Do we need FCVAR_NOTIFY set for this? Only admins are going to care if this changes...

    Installation Instructions:
    Drop the .smx file in your plugins directory. Change maps or restart the server or issue a load command.

    Versions:
    * 2013-01-14 - 0.1.1 - initial internal dev version
    * 2013-01-14 - 0.1.2 - initial testing complete, enabled map chg
    * 2013-01-14 - 0.1.3 - ADD TIME TO LOG, CHG MAP TO NUCLEUS, del commented out code
    * 2013-01-14 - 0.1.4 - add cvar for default map
    * 2013-01-14 - 0.1.5 - chk when cvar is set if its valid
    * 2013-01-14 - 0.1.6 - elminate extra code, tidy up names, add comments
    Attached Files
    File Type: sp Get Plugin or Get Source (automapchanger.sp - 2152 views - 5.6 KB)

    Last edited by Malachi; 01-23-2013 at 09:33.
    Malachi is offline
    johnng0102
    Member
    Join Date: Jun 2012
    Location: HK
    Old 01-22-2013 , 03:52   Re: [ANY] Auto Map Changer
    Reply With Quote #2

    Hi

    I tested your plugin & worked in l4d2. how to set 2 or above maps in your plugin ?

    e.g. (sm_automapchanger_map <mapname A>) first 10mins
    sm_automapchanger_map <mapnameB> next 10 mins
    etc……….

    sorry for my bad English.
    johnng0102 is offline
    Sheepdude
    SourceMod Donor
    Join Date: Aug 2012
    Location: Chicago
    Old 01-22-2013 , 05:00   Re: [ANY] Auto Map Changer
    Reply With Quote #3

    This plugin supposedly does that: https://forums.alliedmods.net/showthread.php?t=199800
    __________________
    Sheepdude is offline
    Malachi
    Senior Member
    Join Date: Jun 2010
    Location: USA
    Old 01-22-2013 , 17:29   Re: [ANY] Auto Map Changer
    Reply With Quote #4

    Quote:
    Originally Posted by johnng0102 View Post
    Hi

    I tested your plugin & worked in l4d2. how to set 2 or above maps in your plugin ?

    e.g. (sm_automapchanger_map <mapname A>) first 10mins
    sm_automapchanger_map <mapnameB> next 10 mins
    etc……….

    sorry for my bad English.
    Thanks for trying it out in l4d2 - good to know it works there too.

    Well, it's supposed to be simple so I only have one map. If you have some kind of timelimit set and the map changes, it will change the map back as long as the server remains empty.

    So you want the server to keep switching between two maps? Is there a reason you need this?
    Malachi is offline
    Malachi
    Senior Member
    Join Date: Jun 2010
    Location: USA
    Old 01-22-2013 , 17:33   Re: [ANY] Auto Map Changer
    Reply With Quote #5

    Quote:
    Originally Posted by Sheepdude View Post
    Doh!


    Yes, these two are very similar. Mine has the (small) advantage of needing less setup.

    If I eventually get around to adding the automatic default map depending on game then maybe I will have a little more to shout about.
    Malachi is offline
    Oshizu
    Veteran Member
    Join Date: Nov 2012
    Location: Warsaw
    Old 01-22-2013 , 17:39   Re: [ANY] Auto Map Changer
    Reply With Quote #6

    Plugin works very well on my server. Got one request if your accepting them
    How about adding timer how many mins before map changes so we could swap those 10 mins with 25 mins or any other amount of time
    __________________
    ...
    Oshizu is offline
    Malachi
    Senior Member
    Join Date: Jun 2010
    Location: USA
    Old 01-22-2013 , 23:29   Re: [ANY] Auto Map Changer
    Reply With Quote #7

    Quote:
    Originally Posted by Oshizu View Post
    Plugin works very well on my server. Got one request if your accepting them
    How about adding timer how many mins before map changes so we could swap those 10 mins with 25 mins or any other amount of time
    My own take is that if the server's empty, then the time before we do a map change isn't very important. It just needs to be long enough so that if people want to return they have a chance, and not so long that the typical map time limit isn't reached.

    I'm open to possibilities, so if you (or someone) makes a case for it to get added...

    Then again, if someone had a special need, it would be trivial to change the default time and recompile.
    Malachi is offline
    N3OGeorgy
    Junior Member
    Join Date: Jun 2012
    Old 05-16-2014 , 19:33   Re: [ANY] Auto Map Changer
    Reply With Quote #8

    The plugin is running but not working for CS:GO if "sv_hibernate_when_empty" is set to "1".

    Last edited by N3OGeorgy; 05-17-2014 at 10:30.
    N3OGeorgy is offline
    Malachi
    Senior Member
    Join Date: Jun 2010
    Location: USA
    Old 05-21-2014 , 18:11   Re: [ANY] Auto Map Changer
    Reply With Quote #9

    A quick search shows that timers wont run when the server is hibernating, which would explain the problem.

    I can't find out if plugins will still run during hibernation.

    There are a couple of possible solutions.

    One is to immediately change the map after the last person disconnects (but I don't think the current version will work). Another is to check that cvar and temporarily turn off hibernation until the timer runs out and the map changes.

    Preferences? Ideas?

    Last edited by Malachi; 05-21-2014 at 18:16.
    Malachi is offline
    Kaytan
    Junior Member
    Join Date: Dec 2004
    Location: Koblenz; DE
    Old 08-27-2014 , 07:56   Re: [ANY] Auto Map Changer
    Reply With Quote #10

    Hi,

    is there a solution for hibernating server like Insurgency?
    __________________
    cu
    mr.red | Kaytan
    www.dogs-clan.eu


    Kaytan is offline
    Send a message via ICQ to Kaytan
    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 13:07.


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