Results 1 to 10 of 11

Thread: [CoD4] Disable Select Class

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Brigadier General
    Join Date
    Oct 2012
    Posts
    994
    Thanks
    20
    Thanked 588 Times in 388 Posts
    You are looking at the wrong menu. look in raw/ui_mp/scriptments/class.menu and edit it like this:

    Code:
    #include "ui/menudef.h"
    #include "ui_mp/common_macro.inc"
    
    #define CHOICE_SIZE_X			150
    #define CHOICE_SIZE_Y			22
    
    #define CHOICE_X_START			0
    #define CHOICE_Y_START			204 //180
    
    #define CHOICE_GROUP			"class"
    #define CHOICE_SEP_1			4
    
    #include "ui_mp/menustyle.inc"
    #include "ui_mp/choices_setup_teams.menu"
    
    #define ORIGIN_DESCRIPTION		(CHOICE_X_START + 15) 190
    
    {
    	menuDef
    	{
    		name			"class"
    		rect			0 0 640 480
    		focuscolor		COLOR_FOCUSED
    		style			WINDOW_STYLE_EMPTY
    		blurWorld		7.0
    		onOpen
    		{
    			focusFirst;
    		}
    		onEsc 
    		{
    			scriptMenuResponse "back";
    		}
    		
    		#ifndef PC
    		execkeyint BUTTON_START
    		{
    			scriptMenuResponse "back";
    		}
    		#endif
    		
    		// background overlay
    		itemDef
    		{
    			style			WINDOW_STYLE_FILLED
    			rect			0 0 640 480 HORIZONTAL_ALIGN_FULLSCREEN VERTICAL_ALIGN_FULLSCREEN
    			backcolor		0 0 0 0.75 //0 0.05 0.15 0.5
    			visible			1
    			decoration
    		}
    
    		// gradient_top
    		itemDef
    		{
    			style			WINDOW_STYLE_SHADER
    			rect			0 0 854 75 HORIZONTAL_ALIGN_FULLSCREEN 0
    			background		"gradient_top"
    			visible			1
    			decoration
    		}
    
    		// gradient_bottom
    		itemDef
    		{
    			style			WINDOW_STYLE_SHADER
    			rect			0 405 854 75 HORIZONTAL_ALIGN_FULLSCREEN 0
    			background		"gradient_bottom"
    			visible			1
    			decoration
    		}
    		
    		// map display ================================================
    		#include "ui_mp/tactical_map.inc";
    		#define ORIGIN_BANNER		108 48
    
    		itemDef	{
    			style			WINDOW_STYLE_SHADER
    			rect			ORIGIN_BANNER 400 0.5
    			background		"line_horizontal"
    			forecolor		1 1 1 0.85
    			visible			1	decoration	}
    		itemDef	{
    			style			WINDOW_STYLE_SHADER
    			rect			ORIGIN_BANNER 340 10
    			origin			30 1
    			background		"line_horizontal"
    			forecolor		OBJECTIVE_COLOR_MARINES
    			visible			1
    			decoration	}
    		itemDef	{
    			style			WINDOW_STYLE_SHADER
    			rect			ORIGIN_BANNER 400 0.5
    			origin			0 12
    			background		"line_horizontal"
    			forecolor		1 1 1 0.85
    			visible			1	decoration	}
    			
    		itemDef	{
    			rect			-400 64 800 0 HORIZONTAL_ALIGN_CENTER VERTICAL_ALIGN_TOP
    			textstyle		ITEM_TEXTSTYLE_SHADOWED
    			textscale		TEXTSIZE_TITLE
    			textalign		ITEM_ALIGN_CENTER
    			forecolor		1 1 1 0.85
    			exp text ( gametypename() );
    			visible			1	decoration	}
    		itemDef	{
    			rect			-250 84 500 60 HORIZONTAL_ALIGN_CENTER VERTICAL_ALIGN_TOP
    			textstyle		ITEM_TEXTSTYLE_SHADOWED
    			textscale		TEXTSIZE_SMALL
    			textalign		ITEM_ALIGN_CENTER
    			forecolor		1 1 1 0.75
    			exp text( gametypedescription() );
    			autowrapped
    			visible			1	decoration	}
    		
    		// ------------------ TREE TITLE ------------------
    		
    		CHOICE_MENU_TITLE( "@MENU_OPTIONS_UPPER_CASE" )
    		
    		// ------------------ buttons ---------------------
    		#define BACK_OPEN	;
    		#include "ui_mp/navcontrols.inc"
    
    		//=========================================================
    		//===================== MENU SELECTION ====================
    		//=========================================================
    		#include "ui_mp/teamicon.inc"
    
    		// PC widescreen fix
    		#undef  CHOICE_X_START
    		#define CHOICE_X_START	-320
    		
    		#undef	CHOICE_HORIZONTAL_ALIGN
    		#define CHOICE_HORIZONTAL_ALIGN HORIZONTAL_ALIGN_CENTER
    		
    		#define FORCE_CLASS ( dvarbool( scr_force_class ) == 1 )
    
    		CHOICE_BUTTON_BG( 1, when( (TEAM_IS_MARINES || TEAM_IS_OPFOR) && MAY_CHOOSE_CLASS ) )
    		CHOICE_HIGHLIGHT( 1, (TEAM_IS_MARINES || TEAM_IS_OPFOR) && MAY_CHOOSE_CLASS )
    		CHOICE_BUTTON_VIS_NOHI( 1, "@MPUI_CHOOSE_CLASS", scriptMenuResponse "changeclass_marines", when( TEAM_IS_MARINES && MAY_CHOOSE_CLASS && !FORCE_CLASS ) )
    		CHOICE_BUTTON_VIS_NOHI( 1, "@MPUI_CHOOSE_CLASS", scriptMenuResponse "changeclass_opfor", when( TEAM_IS_OPFOR && MAY_CHOOSE_CLASS && !FORCE_CLASS ) )
    		CHOICE_DBUTTON_VIS( 1, "@MPUI_CHOOSE_CLASS", when( dvarInt( scr_oldschool ) == 1 || FORCE_CLASS ); )
    		
    		CHOICE_BUTTON( 2, "@MPUI_CHANGE_TEAM", scriptMenuResponse "changeteam"; )
    
    		CHOICE_SEPARATOR( CHOICE_SEP_1 )
    
    		CHOICE_BUTTON( 3, "@MENU_CONTROLS", close self; open main_controls )
    		CHOICE_BUTTON( 4, "@MENU_OPTIONS", close self; open main_options; execnow "set ui_allow_graphic_change 0"; )
    		
    		CHOICE_BUTTON_VIS( 5, "@MPUI_CALL_VOTE", open callvote; close self;, when( dvarbool( ui_allowvote ) ); )
    		CHOICE_DBUTTON_VIS( 5, "@MPUI_CALL_VOTE", when( !dvarbool( ui_allowvote ) ); )
    		
    		CHOICE_BUTTON( 6, "@MPUI_MUTE_PLAYERS", open muteplayer; close self; )
    		
    		CHOICE_BUTTON_BG( 7, 1 )
    		CHOICE_HIGHLIGHT( 7, 1 )
    		CHOICE_BUTTON_VIS_NOHI( 7, "@MENU_LEAVE_GAME", open popup_endgame, when( dvarbool( sv_running ) ) )
    		CHOICE_BUTTON_VIS_NOHI( 7, "@MENU_LEAVE_GAME", open popup_leavegame, when( !dvarbool( sv_running ) ) )
    
    		#include "ui/safearea.menu"
    	}
    }
    Add class.menu to your mod.csv file:

    Code:
    menufile,ui_mp/scriptmenus/class.menu
    In your server config file, set the dvar:

    Code:
    set scr_force_class "1"
    The class button will appear greyed out and they wont be able to click it.

  2. #2
    Private
    Join Date
    Oct 2013
    Posts
    48
    Thanks
    10
    Thanked 4 Times in 2 Posts
    Quote Originally Posted by Tally View Post
    You are looking at the wrong menu. look in raw/ui_mp/scriptments/class.menu and edit it like this:
    As far as i know "class.menu" is the menu that opens whenever someone uses ESC.
    But if someone joins the first menu that opens is "team_marinesopfor.menu".
    I changed both menu's and "class.menu" is working fine. If you change to spectator and then to player it doesnt open the choose class.
    But on first connect if you choose the team it will open choose class.

  3. #3
    Brigadier General
    Join Date
    Oct 2012
    Posts
    994
    Thanks
    20
    Thanked 588 Times in 388 Posts
    Quote Originally Posted by DjTranceFire View Post
    As far as i know "class.menu" is the menu that opens whenever someone uses ESC.
    But if someone joins the first menu that opens is "team_marinesopfor.menu".
    I changed both menu's and "class.menu" is working fine. If you change to spectator and then to player it doesnt open the choose class.
    But on first connect if you choose the team it will open choose class.
    You asked me how to disable someone choosing a class. I did that. What else is needed?
    Last edited by Tally; 12th March 2014 at 13:16.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •