Raised This Month: $51 Target: $400
 12% 

[CS:GO] Change game type/mode via admin menu with proper map group


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Ombra
Junior Member
Join Date: Nov 2009
Old 01-31-2013 , 12:52   [CS:GO] Change game type/mode via admin menu with proper map group
Reply With Quote #1

Hello guys,

here is another solution to a problem that i have encountered when setting up my server. Hopefully this will help others too

THE PROBLEM:
Since i'm running a one instance server in my house, sometimes i'm playing with my buddies and i want to switch mode. Normally i would have to kill the server and start it again from another shortcut using the appropriate switches to run it in another mode. This obviously disconnects my friends and makes us loose a lot of time in the process of connecting again and restarting the game once everybody connects to the server.

While trying to find a solution to this problem i stumbled upon a plugin that ALMOST solved my problem. This plugin is: Rock The Mode found @ http://forums.alliedmods.net/showthread.php?t=196148
The plugin worked pretty well considering it has a command that once issued switches mode immediately.
"You just add them to the admin menu and boom!" you would say, but it is not even remotely close to that.

Other issues popped up. Mainly the fact that admin menu wasn't issuing the commands properly, second the fact that it would change mode on current level (immagine arms race in dust2) and third the mapcycle would be messed up.

I will explain how i managed to fix all of it and integrate my fix for mapcycle found here: https://forums.alliedmods.net/showth...18#post1884118

THE SOLUTION:

1. Install the plguin RockTheMode from http://forums.alliedmods.net/showthread.php?t=196148

2. Go to \csgo\cfg\sourcemod\ folder and create one cfg file for each mode ("mode_armsrace.cfg" and so on).

3. Go to \csgo\addons\sourcemod\configs\ folder and modify "adminmenu_cfgs.txt" as follows (or according to the modes that you use):
Code:
/**
 * List config files here (relative to moddir) to have them added to the exec config menu list
 * Left side is the filename, right side is the text to be added to the menu
 */
Configs
{
	"cfg/sourcemod/mode_competitive.cfg"			"Casual Competitive"
	"cfg/sourcemod/mode_armsrace.cfg"			"Arms Race"
	"cfg/sourcemod/mode_demolition.cfg"			"Demolition"
	"cfg/sourcemod/mode_deathmatch.cfg"			"Deathmatch"
}
This will add the entries to the admin menu.

4. Make sure that you modify "adminmenu_sorting.txt" and add the following in the order you like:
Code:
	"ServerCommands"
	{
		"item"		"sm_execcfg"
	}
This will ensure that what is inside the previous file we modified will be displayed in the admin menu under Server Commands -> Exec CFGs (weird but is the only way, trust me)

5. Now we have to define what goes inside each CFG file that we created inside \csgo\cfg\sourcemod\ folder. I will break it down just to explain what each command does (in theory).
Take for example the file "mode_armsrace.cfg". Here is the content of mine:
Code:
sm_nextmap "ar_baggage"
mapgroup mg_armsrace
sm_cvar mapcyclefile "mapcycle_armsrace.txt"
sm_rtm_mode armsrace
changelevel ar_shoots
and here is the breakdown:
Code:
sm_nextmap "ar_baggage" //Defines the SECOND map inside your mapcyclefile
mapgroup mg_armsrace //Defines the proper mapgroup just for the heck of it since not working
sm_cvar mapcyclefile "mapcycle_armsrace.txt" //Define using sm_cvar, since it does not exist as a regular cvar, the mapcycle file of the new mod
sm_rtm_mode armsrace //Uses the plugin to actually change the mode to the proper one
changelevel ar_shoots //Loads the map corresponding to the FIRST one inside your mapcycle file.
That's it!! REMEMBER: for the CFG to work with the correct mapcycle you have to apply my mapgroup/mapcycle workaround @ https://forums.alliedmods.net/showth...18#post1884118

I've tested this multiple times and it works like a charm. Server switches mode, loads proper mapcycle and won't disconnect users. I haven't found any side effects yet. If you do let me know.

Have fun!!

Last edited by Ombra; 01-31-2013 at 13:10.
Ombra is offline
Sheepdude
SourceMod Donor
Join Date: Aug 2012
Location: Chicago
Old 02-02-2013 , 18:44   Re: [CS:GO] Change game type/mode via admin menu with proper map group
Reply With Quote #2

I've updated Next Map Mode to hopefully alleviate some of the problems you've addressed. =)
__________________

Last edited by Sheepdude; 02-02-2013 at 18:44.
Sheepdude is offline
chinagreenelvis
Senior Member
Join Date: Dec 2009
Old 02-09-2013 , 17:51   Re: [CS:GO] Change game type/mode via admin menu with proper map group
Reply With Quote #3

Is there any way to make this random?
chinagreenelvis is offline
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 18:30.


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