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

Auto Map Change On Not Empty/EmptyServer


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   Counter-Strike        Category:   Server Management        Approver:   EKS (166)
raffe2
Member
Join Date: Dec 2005
Old 12-29-2005 , 18:25   Auto Map Change On Not Empty/EmptyServer
Reply With Quote #1

This plugin is not totally unique, because it is based on "Auto Map Change On Empty Server 1.42" by twistedeuphoria here:
http://forums.alliedmods.net/showthread.php?t=5437

So, it is more like a bigger modification. But I find it usefull, so I thought maybe others did also... I also got help from bmann_420 in the forum, se this URL http://forums.alliedmods.net/showthread.php?t=22533

Don't really know what to call it, so I simply named it "Auto Map Change On Not Empty/EmptyServer"...

My modification/simmilarity is:
- Changes map when server is empty (same as 1.42)
- Changes map when not empty any more (unique)
- Changes mp_timelimit depending on empty/not empty (unique)
- With this you can have a "trash map" for false statistics (unique)

I did it to prevent the server to do map cycles without players, so that I don't get false Round statistics and false Online Time statistics (I use PsychoStats).

Description
So, this plugin will change maps to the special one in cvars and also change the mp_timelimit if there are zero players connected after a defined amount of time. The map and mp_timelimit will also change if the only clients in the game have not been playing for a certain number of hours, which is set in a cvar, or if your server has only bots in it. When a player connect, it change the mp_timelimit and map to the other special ones in cvars. You can also get it to change to next map in cycle when a player connects.

Cvars:
Code:
// // Change log: 0.8 2008-07-21, Fixing so that admins counts as players. //             0.7 2006-01-21, Fixing spelling mistakes in change log text. //             0.6 2006-01-03, Fixing nextmap possibility. Changed //                 to set_cvar_num for mp_timelimit. Mp_timelimit keeps //                 record of which map is in use (players map or empty map). //             0.5 2005-12-31, Fixed another bug in change_maps_forplayer(), //                 it changed back to amx_map_players every map change. //             0.4 2005-12-31, Fixed bug in change_maps_forplayer(), //                 equal(curmap, map_empty) -> equal(curmap, map_players) //             0.3 2005-12-30, changed change_maps() and //                 change_maps_forplayer() so it only makes changelevel if //                 amx_map_empty and amx_map_players are different. E.g. if //                 you have de_dust in both it only makes changelevel when //                 empty, but only mp_timelimit if a player connects. //             0.2 2005-12-29, Started this change log. //             0.1 2005-12-29, first version done. // // // amx_staytime(in seconds):      How long before the plugin changes the map. // // amx_map_empty(map_name):       This is the map you want to change to if //                                the server is empty. //                        Read!-> If you write "amx-nextmap" it will use the //                                next map in the map cycle. // // amx_map_players(map_name):     This is the map you want to change to when //                                the server is not empty any more. //                        Read!-> If you write "amx-nextmap" it will use the //                                next map in the map cycle. // // amx_timelimit_empty(minutes):  This is the mp_timelimit you want to have //                                if the server is empty. //                        Read!-> It can NOT be same value as //                                amx_timelimit_players (under) // // amx_timelimit_players(minutes):This is the mp_timelimit you want to have //                                if the server is not empty any more. //                        Read!-> It can NOT be same value as //                                amx_timelimit_empty (above) // // amx_idletime(in hours):        How many hours a player can be connected to //                                the server before being considered idle. // // amx_map_memory(0):             DON'T CHANGE THIS ONE. Plugin uses this to //                                get the amx-nextmap to work OK. //
Attached Files
File Type: sma Get Plugin or Get Source (emptyserver2.sma - 4514 views - 6.2 KB)

Last edited by raffe2; 07-21-2008 at 14:15.
raffe2 is offline
Lord_Destros
Veteran Member
Join Date: Jul 2004
Location: With stupid.
Old 12-29-2005 , 19:30  
Reply With Quote #2

don't post the .amxx, when posting the .sma it can auto compile

also with cvars you don't have to post all of the code.
__________________
Quote:
Originally Posted by Twilight Suzuka
Don't worry m'lord. The turtles day will come.
Lord_Destros is offline
Send a message via AIM to Lord_Destros
raffe2
Member
Join Date: Dec 2005
Old 12-29-2005 , 19:44  
Reply With Quote #3

Quote:
Originally Posted by Lord_Destros
don't post the .amxx, when posting the .sma it can auto compile. also with cvars you don't have to post all of the code.
OK, fixed that...
raffe2 is offline
Lord_Destros
Veteran Member
Join Date: Jul 2004
Location: With stupid.
Old 12-29-2005 , 20:32  
Reply With Quote #4

also, what do you mean a trash map for false statistics? What does it do?
Also for the check if a person is idle, does it go over map changes if you have an sv_downloadurl?
__________________
Quote:
Originally Posted by Twilight Suzuka
Don't worry m'lord. The turtles day will come.
Lord_Destros is offline
Send a message via AIM to Lord_Destros
bmann_420
AMX_Super Pooper
Join Date: Jan 2005
Location: [SuperCentral.co]
Old 12-29-2005 , 20:42  
Reply With Quote #5

In other words, if the timelimit is at 0 the plugin gets to work way less and cause less issues.

Im glad you posted it too, good job on all the work.

And thank you for some credit, much appreciated.

The only thing i find funny, is that when somebody joins your map to play it, then it changes right when they join. lol But I guess that is why there are cvars.
__________________
bmann_420 is offline
raffe2
Member
Join Date: Dec 2005
Old 12-29-2005 , 20:51  
Reply With Quote #6

Quote:
Originally Posted by Lord_Destros
also, what do you mean a trash map for false statistics? What does it do?
What I wanted to do:
1. When empty:
a) Change to map "Waiting_for_players"
b) Set server cvar "mp_timelimit" = "0"
c) If it already is map "Waiting_for_players", don't do anything

Then the server don't cycle maps and I don't get frags, round counts and online time on the other maps. I downloaded the map fy_rockarena and renamed it Waiting_for_players.bsp, so it gets the one round count (but no frags or online time).

2. When someone connects:
a) Check is someone connects.
b) Change to map "de_dust"
c) Set server cvar "mp_timelimit" = "30"
d) Put in some bots
e) Maybe later possibility to change "back" to what would have been nextmap (with server cvar "amx_nextmap")

And I use Zbot:
I) I added this to server.cfg:
bot_kick all
bot_add_ct
bot_add_t
bot_add_ct
bot_add_t
bot_add_ct
bot_add_t
bot_add_t
II) In Zbot I use "bot_join_after_player = 1"
III) When it changes to Waiting_for_players, there is no bots because there is no real players
IIII) When a player connects it changes to another map and bots connects because there is real players

So when server changes to Waiting_for_players.bsp, the server is idle (see attached pic, the "Time" never changes).
Attached Thumbnails
Click image for larger version

Name:	liveserverview.jpg
Views:	1135
Size:	64.5 KB
ID:	4924  
raffe2 is offline
bmann_420
AMX_Super Pooper
Join Date: Jan 2005
Location: [SuperCentral.co]
Old 12-29-2005 , 21:02  
Reply With Quote #7

you ever think of makeing this plugin so when nobody is there then it goes to de_dust with no roundtime. and when somebody joins the bots join and the time is back to 40?
__________________
bmann_420 is offline
raffe2
Member
Join Date: Dec 2005
Old 12-30-2005 , 01:26  
Reply With Quote #8

Quote:
Originally Posted by bmann_420
you ever think of makeing this plugin so when nobody is there then it goes to de_dust with no roundtime. and when somebody joins the bots join and the time is back to 40?
I have been thinking of these possibillities:
1. Connect to de_dust with "mp_timelimit = 0". This gives one round count to de_dust.
*** This one works today (kind of, will get better) ***

2. Connect to map Waiting_for_players with "mp_timelimit = 0". This gives one round count to Waiting_for_players.
*** This one works today ***

3. Connect to "nextmap" with "mp_timelimit = 0". This gives one round count to the "next map".

4. Connect to map Waiting_for_players with "mp_timelimit = 0", "mp_roundtime = 0" and then start up a game with no bots. This gives one round count to Waiting_for_players and counts the time when the server is empty of people.

I am planing to do svars for 3 and 4 later (when I have slept a little)...
raffe2 is offline
bmann_420
AMX_Super Pooper
Join Date: Jan 2005
Location: [SuperCentral.co]
Old 12-30-2005 , 14:06  
Reply With Quote #9

Are you running cstrike? If so you can always just get podbot_mm and always have like 4 bots in the server so people join. When 1 person joins, 1 bot leaves and so on till all the bots are gone and only people are there. That is how i believe you get your server to have people on it.
__________________
bmann_420 is offline
raffe2
Member
Join Date: Dec 2005
Old 12-30-2005 , 15:54  
Reply With Quote #10

I have updated my SMA file and svar desciption. It now work "better" if you use same map when empty and not empty.
Code:
// Change log: 0.3 2005-12-30, changed change_maps() and  //                 change_maps_forplayer() so it only makes changelevel if  //                 amx_map_empty and amx_map_players are different. E.g. if  //                 you have de_dust in both it only makes changelevel when  //                 empty, but only mp_timelimit if a player connects.
Will now start to implement this one:
3. Connect to "nextmap" or to a "waiting" map with "mp_timelimit = 0" when empty. When a player connects, it uses "nextmap" and changes the timelimit. The the map cycle only pauses, and the continues hen a player connects.

Quote:
Originally Posted by bmann_420
Are you running cstrike? If so you can always just get podbot_mm and always have like 4 bots in the server so people join. When 1 person joins, 1 bot leaves and so on till all the bots are gone and only people are there. That is how i believe you get your server to have people on it.
Thanks for the idea, will look in to it.
raffe2 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 19:32.


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