Day of Defeat Plugins Community
This site is an archive — everything is readable and downloadable, nothing can be posted. Admin
Archive › Old Forum Threads › General › Requests for DoD Plugins › Server Capacity Mapchooser
23 posts, 7 people · 12,941 views Thread Rating: ★★★★★
closedServer Capacity Mapchooser
Started by gunsofnavarone on 05-25-2009, 09:35 AM
G gunsofnavarone
started this thread
Posts: 159
Threads: 28
Joined: Sep 2008
05-25-2009, 09:35 AM #1

This was a passing thought about offering a completely different set of maps to choose from based on number of people on a server (excluding bots as they can't vote).rnrnThe idea was something like this:rnrn1-8 Players.......Map Group A (small maps - Smaps.ini)rnrn9-16 Players.....Map Group B (medium maps - Mmaps.ini)rnrn17-32 Players...Map Group C (Large maps - Lmaps.ini)rnrnThe server would call upon one of these files at voting time based upon the capacity of the server at that time.rnrnMaybe even be able to adjust the Player number variable also. For instance, modifying Group A for 1-6 Players, Group B for 7-12 Players, and Group C for 13-20 Players (If your server capacity is only 20 vs 32).rnrnOften times (especially with new players to DoD, or even some quite old maps that haven't been played in a very long time), people don't recall the map by it's name, and so they may choose something that is very large for a very small group of players only to find this out after loading the map and maybe (if the plugin is present on the server) have to wait for a certain amount of time before they can "rockthevote". If a RTV plugin isn't available on a particular server, then the odds are, the players will drop and move elsewhere.rnrnOf course, all of this could be overridden by admin. For example, let's say your server is filled to/near full capacity, and you want to have some excitement on the server. Maybe you wish a smaller map with the large group of players that you have. The admin could easily select any map from the standard mapcycle.txt or maps.ini file.

Dr.G
posted here
Posts: 776
Threads: 75
Joined: Nov 2007
05-25-2009, 11:16 AM #2

makeing a plugin with rtv vote etc. is a big thing, i wont do that. But i can easy make a plugin that will set the map cycle file to blahblah.cfg if X amount of ppl is playing. the server got a var. for what file to use as map cycle file. rnrnTry and say: mapcyclefile in hlsw and the respond will proberbly be:rnrn

nn:nn:nn "mapcyclefile" is "mapcycle.txt"
rnrnand thats the var. we can change. rnrnA map manager that will/can use eg. the map cycle is Deagles' Map ManagementrnrnIf that can help ya i will make it.

meathead
posted here
Posts: 337
Threads: 23
Joined: Aug 2007
05-25-2009, 12:23 PM #3

When I was first starting out, I helped someone set up somethings in their server. I noticed they had a different mapcycle set up for the days of the week. It's real similar in concept. You might search for it, IDK.

G gunsofnavarone
started this thread
Posts: 159
Threads: 28
Joined: Sep 2008
05-25-2009, 12:26 PM #4

No, I was not suggesting a plugin with RTV. I was only explaining why and how the plugin would be useful.rnrnJust a plugin that would load a mapfile of maps to vote on based upon how many real people are on the server.

G gunsofnavarone
started this thread
Posts: 159
Threads: 28
Joined: Sep 2008
05-25-2009, 12:28 PM #5

BTW, I have Deagle's map manager, I like it, but thought this would be more useful, or maybe even a modified version of it.

N noddy
posted here
Posts: 250
Threads: 19
Joined: Oct 2004
05-26-2009, 05:36 AM #6
When I was first starting out, I helped someone set up somethings in their server. I noticed they had a different mapcycle set up for the days of the week. It's real similar in concept. You might search for it, IDK.
rnrnI think you might be talking about this m8rnrnTimeconfigs V1.1 rnrnhttp://forums.alliedmods.net/showthread.php?p=602784

Dr.G
posted here
Posts: 776
Threads: 75
Joined: Nov 2007
05-26-2009, 10:28 AM #7

nice find noddy. well if i should do this i would just use a map manager that uses the mapcycle file, and the code how to set what mapcycle file to use would be something like this:rnrnrn

////////////////////////////////////////////////////////////////////////////////////////////////////rn#include <amxmodx>rn////////////////////////////////////////////////////////////////////////////////////////////////////rn#define PLUGIN "map cycle cfg thing"rn#define VERSION "1.0"rn#define AUTHOR "author"rn////////////////////////////////////////////////////////////////////////////////////////////////////rnnew players_online // the is just a single cell that will hold the amount of playersrnnew A_amount, B_amount, C_amount // theres we use for holding the value for your cvarsrn////////////////////////////////////////////////////////////////////////////////////////////////////rnpublic plugin_init() rn{rn	register_plugin(PLUGIN, VERSION, AUTHOR)rn	rn	A_amount = register_cvar("cvar_1","10")rn	B_amount = register_cvar("cvar_2","15")rn	C_amount = register_cvar("cvar_3","20")rn}rn////////////////////////////////////////////////////////////////////////////////////////////////////rnpublic client_putinserver(id) // when a player joins the server this function is calledrn{rn	players_online + 1 	// plus 1rn	set_map_cfg()		// do the mathrn}rn////////////////////////////////////////////////////////////////////////////////////////////////////rnpublic client_disconnect(id) // when a player leaves the server this function is calledrn{rn	players_online - 1	// minus 1rn	set_map_cfg()		// do the mathrn}rn////////////////////////////////////////////////////////////////////////////////////////////////////rnpublic set_map_cfg()rn{rn	// here we use a "static" the reason why is cuz a normal "new" would just disappear when rn	// our math below is done, the static stays = less memory use, but in this case it doesnt rn	// really matter cuz it doesnt happen that often, but why not do it right when we know it...rn	// Overall you dont need to say or make new's here to hold the values, but its easyier thenrn	// writing get_pcvar_num evey single time.rn	static A, B, C rn	A = get_pcvar_num(A_amount) rn	B = get_pcvar_num(B_amount) rn	C = get_pcvar_num(C_amount)rnrn	// if players_online is less or equal to A or 0 -> do "something"rn	if(players_online <= A || 0) rn	{rn		// server_cmd will do the command for usrn		server_cmd("mapcyclefile map_cycle_A.cfg")rn		returnrn	}rn	// if players_online is greater then A AND A is less then B -> do "something"rn	if( players_online > A && A<B )rn	{rn		server_cmd("mapcyclefile map_cycle_B.cfg")rn		returnrn	}rn	// if players_online is greater or equal to C -> do "something"rn	if(players_online >= C)rn	{rn		//inside these braches is "something" rn		server_cmd("mapcyclefile map_cycle_B.cfg")rn		returnrn	}rn}rn////////////////////////////////////////////////////////////////////////////////////////////////////
rnrnThe line starting with // is comments! This is really simple

G gunsofnavarone
started this thread
Posts: 159
Threads: 28
Joined: Sep 2008
05-29-2009, 08:22 AM #8

So is the above the code for us to compile into the amxx, or is this just an example of where it's headed?

Dr.G
posted here
Posts: 776
Threads: 75
Joined: Nov 2007
05-29-2009, 11:48 AM #9

if you read the code and my comments, doesnt it make any sense then?

G gunsofnavarone
started this thread
Posts: 159
Threads: 28
Joined: Sep 2008
05-30-2009, 09:23 AM #10

To be honest, I don't know. It looked like you were maybe giving an example to noddy (hence the comments in the script). Since I don't have a complete understanding of how to script, reading the code or script doesn't tell me it's complete. It is because I have an understanding about math and variables, that it's not difficult for me understand some of the things that a script may contain.rnrnSo forgive my ignorance. Usually there is an attached .sma and/or amxx compiled version.rnrnSo at this point I'll assume that it is complete, and try to go and compile it.rnrnThanx.

G gunsofnavarone
started this thread
Posts: 159
Threads: 28
Joined: Sep 2008
05-30-2009, 09:54 AM #11

Also, I'm not entirely sure, but shouldn't the last portion of the code read:rnrnserver_cmd("mapcyclefile map_cycle_C.cfg")

B bonjour
posted here
Posts: 8
Threads: 1
Joined: Mar 2016
03-11-2016, 08:23 PM #12

Hi, I'm French , I apologize for my English Approximate . I read the topic , and this interested me a lot. But I do not understand how to put the code on the server .... We must compile it ? Can you explain in more detail please ????

F Fysiks
posted here
Posts: 108
Threads: 3
Joined: Aug 2007
03-12-2016, 12:38 AM #13

Here is a document that describes installing plugins for AMX Mod X.rnrnYou can compile plugins here.

B bonjour
posted here
Posts: 8
Threads: 1
Joined: Mar 2016
03-12-2016, 05:44 AM #14

I know to install a plugin. But there is no SMA or amxx file. I try the code complier amxx but once installed on the server it does not work ...

F Fysiks
posted here
Posts: 108
Threads: 3
Joined: Aug 2007
03-12-2016, 02:26 PM #15

What map choosing plugin are you using? Most that I know of only load the mapcyclefile once at the beginning of the map so this wouldn't change how it works.

B bonjour
posted here
Posts: 8
Threads: 1
Joined: Mar 2016
03-12-2016, 03:39 PM #16

The mapcycle I work. But I want to have a mapcycle that changes depending on how many people there are on the server. And as is the main topic, I post here ....

F Fysiks
posted here
Posts: 108
Threads: 3
Joined: Aug 2007
03-13-2016, 05:06 PM #17

What map choosing plugin are you using?

Zor
posted here
Posts: 688
Threads: 75
Joined: Jun 2006
03-19-2016, 11:57 AM #18
... You can compile plugins here.
rnrnWow, didn't you know we have our own here Fysiks!rnrnCompile here.rnrnWhich btw has the most up to date Amxmodx Compiler.rnCheers!

F Fysiks
posted here
Posts: 108
Threads: 3
Joined: Aug 2007
03-19-2016, 02:10 PM #19
Wow, didn't you know we have our own here Fysiks!n
nnNope. I know that you have the compiler for attachments (which I never use) but I've never needed a web compiler and I frequent the AlliedModders forum more often.

Zor
posted here
Posts: 688
Threads: 75
Joined: Jun 2006
03-21-2016, 08:37 AM #20

All cool. Just wanted to make ppl aware. Its on the left Navigation Panel.rnrnCheers!

B bonjour
posted here
Posts: 8
Threads: 1
Joined: Mar 2016
06-12-2016, 08:25 AM #21

one to help me then? :(

F Fysiks
posted here
Posts: 108
Threads: 3
Joined: Aug 2007
06-12-2016, 02:17 PM #22

What do you need help with?

B bonjour
posted here
Posts: 8
Threads: 1
Joined: Mar 2016
06-12-2016, 03:01 PM #23

Tell Me How To That the choice of cards is done based on the number of players . please

Archive › Old Forum Threads › General › Requests for DoD Plugins › Server Capacity Mapchooser
DoD Plugins Archive · Repository · Old Forum Threads · Maps · Admin · built 14 Sep 2026 00:34 UTC