AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugins (https://forums.alliedmods.net/forumdisplay.php?f=108)
-   -   Default Map Changer (https://forums.alliedmods.net/showthread.php?t=141399)

tigerox 10-23-2010 16:14

Default Map Changer
 
12 Attachment(s)
Default Map Changer

Description:
Changes the map to default if the server is empty.

There are a lot of auto map changers out there but none of them did what I wanted. This is a very simple default map changer with no cvars or timers. Most server operators set their startup map to the servers most common or default map. This plugin uses the server's first start map as the default. If the server empties out the map will be changed back to default.

Features:
- Uses your server's first start map as default.
- Keeps the server from changing maps if mp_timelimit has expired and a player connects.
- Compatible with SourceTV.
- Compatible with Counter-Strike: Global Offensive.

Installation:
Copy the plugin to your addons/sourcemod/plugins folder and restart the server.

Changelog:
Code:

05/09/12 - Version 2.5
- Fixed a player count bug related to fake clients.

29/08/12 - Version 2.3
- Fixed typo which broke version 2.2.
- Added MIN_PLAYERS define in code for easy modification.

09/08/12 - Version 2.0
- Improved player counting method.
- Fixed default map not being set if all players disconnected during a map change.


GrO 10-24-2010 01:18

Re: Default Map Changer
 
Simple = good, so good job.

How long the server must be empty for plugin to change the map? Maybe there should be a Cvar for emptyness time?

tigerox 10-24-2010 06:15

Re: Default Map Changer
 
Quote:

Originally Posted by GrO (Post 1332771)
Simple = good, so good job.

How long the server must be empty for plugin to change the map? Maybe there should be a Cvar for emptyness time?

There is no time limit. The server is changed back to default as soon as it is empty.

tigerox 10-27-2010 07:43

Re: Default Map Changer
 
Code:

27-10-10

Small optimization made.

Updated to Version 1.1


bluechester 10-27-2010 10:34

Re: Default Map Changer
 
Does this work if there are no players, but bots in your server?

tigerox 10-27-2010 10:43

Re: Default Map Changer
 
Quote:

Originally Posted by bluechester (Post 1335025)
Does this work if there are no players, but bots in your server?

Yes. It should.

Wylie 10-28-2010 08:28

Re: Default Map Changer
 
Quote:

Originally Posted by tigerox (Post 1332541)
Default Map Changer

Description:
Changes the map to default if the server is empty.

There are a lot of auto map changers out there but none of them did what I wanted. This is a very simple default map changer with no cvars or timers. Most server operators set their startup map to the servers most common or default map. This plugin uses the server's first start map as the default. If the server empties out the map will be changed back to default.

Features:
- Uses your server's first start map as default.
- Keeps the server from changing maps if mp_timelimit has expired and a player connects.
- Changing the map via console, while the server is empty, will temporarily disable the default map switch. (Next time the server is empty it will change to default.)
- Compatible with SourceTV.

Installation:
Copy the plugin to your addons/sourcemod/plugins folder and restart your server.

I tried to use this Map changer but i didn't understand its settings.Can you guide me?

tigerox 10-28-2010 13:17

Re: Default Map Changer
 
Quote:

Installation:
Copy the plugin to your addons/sourcemod/plugins folder and restart your server.
There are no settings. It will change to your servers starup map (default map) if the server becomes empty.

hksjun 10-31-2010 02:50

Re: Default Map Changer
 
Force Mission Changer cant use in same time.if player finish final map always change servers starup map (default map)

cant auto change next map(have player in server.server is not idel).

tigerox 10-31-2010 10:08

Re: Default Map Changer
 
Quote:

Originally Posted by hksjun (Post 1338050)
Force Mission Changer cant use in same time.if player finish final map always change servers starup map (default map)

cant auto change next map(have player in server.server is not idel).

Force Mission Changer also changes the map when the server is empty. I don't see why you would run both of these together. They are not compatible with each other.

hksjun 10-31-2010 11:38

Re: Default Map Changer
 
Quote:

Originally Posted by tigerox (Post 1338262)
Force Mission Changer also changes the map when the server is empty. I don't see why you would run both of these together. They are not compatible with each other.



if player non stop play.use Force Mission Changer can auto change next map.

if server is empty auto change starup map (default map)

can help me do this?thanks

because your plugin can help me fix "the passing" bug

if all player in "the passing" leave.server change to idle
have player join on this time.server will crash.get this error

5/ - survivor_bot: UTIL_SetModel: not precached: models/survivors/survivor_teenangst.mdl
5/ - survivor_bot: UTIL_SetModel: not precached: models/survivors/survivor_biker.mdl


http://forums.steampowered.com/forum....php?t=1241279

tigerox 11-06-2010 12:38

Re: Default Map Changer
 
This might fix your problem. Everyone should update anyways.

06/11/10 - Version 1.2
- Fixed a bug where multiple map changes were requested.

tigerox 11-11-2010 18:23

Re: Default Map Changer
 
11/11/10 - Version 1.3
- Fixed a bug where the map was not changed to default.

Ares Veteran 07-01-2011 02:51

Re: Default Map Changer
 
What should i change in source code if i want a "default map change" on min. 4 players?

Or can you please make it configurable? That would be fine, cause i cant find another working plugin for our server. :/

Ares Veteran 02-21-2012 07:32

Re: Default Map Changer
 
Quote:

Originally Posted by Ares Veteran (Post 1500899)
What should i change in source code if i want a "default map change" on min. 4 players?

Maybe change if(!--g_PlyrCount) to if(g_PlyrCount < 4)?:
Code:

        if(g_PlyrCount < 4)
        {               
                decl String:iBuffer[MAX_MAPNANE_LENGTH];
                GetCurrentMap(iBuffer,MAX_MAPNANE_LENGTH);
                       
                if(!StrEqual(iBuffer,g_DefaultMap))
                {
                        ForceChangeLevel(g_DefaultMap, "Server empty. Going to default map...");
                }
        }

Sorry im not a coder, im just playing around... And try to do the modification by myself :)

tigerox 08-09-2012 17:52

Re: Default Map Changer
 
Updated!

Code:

09/08/12 - Version 2.0
- Improved player counting method.
- Fixed default map not being set if all players disconnected during a map change.


SilentBr 08-17-2012 12:27

Re: Default Map Changer
 
Stupid question but I have to ask.

What about if the server got empty in the default map, will it reload the map again? I am asking this because I am running a MvM server and after get empty need change the map to kick the bots.

Thank you.

tigerox 08-19-2012 15:44

Re: Default Map Changer
 
6 Attachment(s)
Quote:

Originally Posted by SilentBr (Post 1774140)
Stupid question but I have to ask.

What about if the server got empty in the default map, will it reload the map again? I am asking this because I am running a MvM server and after get empty need change the map to kick the bots.

Thank you.

It does not currently reload if on the default map. I attached a version that will reload whenever the server becomes empty.

tigerox 08-27-2012 21:58

Re: Default Map Changer
 
Updated!

Code:

27/08/12 - Version 2.2
- Minor performance improvements.


Ares Veteran 08-28-2012 02:09

Re: Default Map Changer
 
Quote:

Originally Posted by Ares Veteran (Post 1500899)
What should i change in source code if i want a "default map change" on min. 4 players?

Or can you please make it configurable? That would be fine, cause i cant find another working plugin for our server. :/

I like the idea but can you please make a cvar for an minimum player mapchange. I think it is too late to change the map when the server is already empty. :3

TY

tigerox 08-28-2012 12:18

Re: Default Map Changer
 
Quote:

Originally Posted by Ares Veteran (Post 1784802)
I like the idea but can you please make a cvar for an minimum player mapchange. I think it is too late to change the map when the server is already empty. :3

TY

There are a lot of more advanced map changers on here, they will do what you are requesting. This is just a basic default map plugin. If you really want to use this it is a very simply modification to the source.

tigerox 08-29-2012 11:11

Re: Default Map Changer
 
Updated!

Code:

29/08/12 - Version 2.3
- Fixed typo which broke version 2.2.
- Added MIN_PLAYERS define in code for easy modification.


tigerox 08-29-2012 16:51

Re: Default Map Changer
 
Sorry for all the updates, one of my changes had unforeseen consequences. It should be stable and working now. Everyone running this should update to the latest version.

Updated!

Code:

29/08/12 - Version 2.4
- Fixed default map not working by reverting back to GetClientUserId.


Ares Veteran 08-31-2012 07:32

Re: Default Map Changer
 
Quote:

Originally Posted by tigerox (Post 1786154)
Updated!

Code:

29/08/12 - Version 2.3
- Fixed typo which broke version 2.2.
- Added MIN_PLAYERS define in code for easy modification.


Thank you! so it should be easy for me too :)

tigerox 09-05-2012 23:50

Re: Default Map Changer
 
Updated!

Code:

05/09/12 - Version 2.5
- Fixed a player count bug related to fake clients.


tigerox 09-06-2012 04:02

Re: Default Map Changer
 
Anyone using this should update to the latest version.

Inflikted 09-09-2012 11:30

Re: Default Map Changer
 
could you explain what you mean by this "Uses your server's first start map as default" Is it the map written in the commandline to start the server or the first map in the mapcycle.txt.

tigerox 09-09-2012 18:02

Re: Default Map Changer
 
Quote:

Originally Posted by Inflikted (Post 1795233)
could you explain what you mean by this "Uses your server's first start map as default" Is it the map written in the commandline to start the server or the first map in the mapcycle.txt.

It would be the map from your command line. The first map the server loads.

Inflikted 09-12-2012 09:21

Re: Default Map Changer
 
Assuming I don't have to set anything up this plugin doesn't seem to work on TF2 on any of my servers. I don't run bots or anything of that nature, but I test it out myself on several occasions where I changed the map from the default load map and joined then left. Even after an hour it didn't trigger to go back to the start map

tigerox 09-12-2012 09:55

Re: Default Map Changer
 
Quote:

Originally Posted by Inflikted (Post 1797495)
Assuming I don't have to set anything up this plugin doesn't seem to work on TF2 on any of my servers. I don't run bots or anything of that nature, but I test it out myself on several occasions where I changed the map from the default load map and joined then left. Even after an hour it didn't trigger to go back to the start map

Make sure you have the latest version, or re-download the plugin.

You should not be able to change the map when the server is empty. It would immediately change back to default. You would only be able to join the server, change the map, then leave, if you wanted to test it properly. It does work with TF2, I know of a few people using it.

hamilton5 11-19-2012 06:26

Re: Default Map Changer
 
running linux GO server.. v2.5.. if you unload the plugin and then change maps, the plugin gets reloaded and that map becomes your new default map.. I actually like this; being able to change it without shutting down the server :)

Gen6653 01-31-2013 11:39

Re: Default Map Changer
 
I like this plugin, but could you added at least 1 minute for the map change time limit, becuase i always use the changelevel command in the server console before connected to the server.

hamilton5 01-31-2013 12:47

Re: Default Map Changer
 
mod the source yourself.. or just sm_map <newmap> when your in game.. why would you ask him to change it just for yourself, how selfish ;]

tigerox 02-19-2013 09:39

Re: Default Map Changer
 
Quote:

Originally Posted by hamilton5 (Post 1894585)
thanks to this plugin my server doesn't get whored out. When valve changes my server map its back to my default before the user joins ;) I don't even use the host_workshop_collection but I wonder why sv_workshop_allow_other_maps dosent work ;\

I don't think sv_workshop_allow_other_maps works if you are not using a workshop collection.

hamilton5 02-19-2013 10:10

Re: Default Map Changer
 
It doesn't work either way. you have to start up with +map and never use the host_workshop_collection, once you do its theirs :(

allienaded 04-18-2013 18:02

Re: Default Map Changer
 
2 Attachment(s)
Quote:

Originally Posted by Gen6653 (Post 1884087)
I like this plugin, but could you added at least 1 minute for the map change time limit, becuase i always use the changelevel command in the server console before connected to the server.

I added a 1 minute delay before changing the map and also made it so that the default map is set using the following cvar: sm_defaultmap instead of being automatically set to the map that the server starts with. The default value for sm_defaultmap is de_nuke but ofcourse you can just add sm_defaultmap "anymap" to your server.cfg or change the cvar on the fly. Also this is the first time I code anything in sourcepawn so someone more experienced feel free to check the code and point out if there's anything that should've been done differently. The plugin compiles with no warnings or errors and I've tested it and found everything works as it should.

PS. For those who can't mod plugins themselves to change or remove the delay change CreateTimer(60.0, ChangeMap) on line 91 to CreateTimer(0.1, ChangeMap) for example. To change the minimum players needed for the map to be set back to the default change #define MIN_PLAYERS 1 on line 5 to #define MIN_PLAYERS 4 for example. After your edits use this to compile the plugin: http://www.sourcemod.net/compiler.php

EDIT: Apparently doesn't work correctly with workshop maps, meaning the default map can only be set as a non-workshop one.

devil0704 04-18-2013 19:24

Re: Default Map Changer
 
I have a problem.
sm_defaultmap "/125488374/de_dust2_se"

When there are no players on the server, the map is constantly changing. Approximately every 5-10 seconds.

allienaded 04-18-2013 19:40

Re: Default Map Changer
 
Quote:

Originally Posted by devil0704 (Post 1935429)
I have a problem.
sm_defaultmap "/125488374/de_dust2_se"

When there are no players on the server, the map is constantly changing. Approximately every 5-10 seconds.

Try sm_defaultmap "de_dust2_se". If that doesn't work then I can't help you sorry my coding knowledge is very limited and I only tested this with non-workshop maps. I just fixed an error in the timer btw (the timer didn't reset even if someone connected) so redownload the plugin.

hamilton5 04-19-2013 06:37

Re: Default Map Changer
 
In reply to allienaded's EDIT.. the plugin works fine for workshop maps... his cvar does not..

Vastrix 07-23-2014 07:02

Re: Default Map Changer
 
Simple and effective, I like :)


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

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