Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: [CoD4] Disable Select Class

  1. #1
    Private
    Join Date
    Oct 2013
    Posts
    48
    Thanks
    10
    Thanked 4 Times in 2 Posts

    [CoD4] Disable Select Class

    Hey there..
    I'm trying to change the "team_marinesopfor" menu file so that players can only join allies.
    Because the weapons are forced its useless that players can choose the class.
    For some reason its seems impossible to disable it.
    The menu calls
    Code:
    scriptMenuResponse "allies";
    _menus.gsc:

    Code:
    case "allies":
    	self [[level.allies]]();
    	break;
    Where is the part that opens the choose class menu?

    Sorry for my bad english! :x

  2. #2
    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.

  3. #3
    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.

  4. #4
    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.

  5. #5
    Private
    Join Date
    Oct 2013
    Posts
    48
    Thanks
    10
    Thanked 4 Times in 2 Posts
    I want the players to choose a team after they connect and after that not have to choose a class.
    Whenever you choose a team you automatically have to choose a class you want to play with.
    Thats the point i want to change because players will get their weapons with codscript.

  6. #6
    Brigadier General
    Join Date
    Oct 2012
    Posts
    994
    Thanks
    20
    Thanked 588 Times in 388 Posts
    Quote Originally Posted by DjTranceFire View Post
    I want the players to choose a team after they connect and after that not have to choose a class.
    Whenever you choose a team you automatically have to choose a class you want to play with.
    Thats the point i want to change because players will get their weapons with codscript.
    Look in _globallogic.gsc and see how it's done for old school. In old school, as soon as you choose a team, you spawn into the game. You by-pass anything else.

  7. #7
    Brigadier General
    Join Date
    Oct 2012
    Posts
    994
    Thanks
    20
    Thanked 588 Times in 388 Posts
    Christ on a Bike! Not one word of thanks.

    That's it. I am fed up helping people and don't even get a thank you. They use you up and spit you out and never a word of thanks for it. Never again.

  8. #8
    Private First Class YuriJurek's Avatar
    Join Date
    Jun 2013
    Posts
    219
    Thanks
    152
    Thanked 88 Times in 47 Posts
    Tally "Life is not fair, get used to it!" one of Bill Gates' rules, I know how frustrating it is helping others and not even getting a word of thank but does it matter? Be proud that you helped someone!

  9. #9
    Private
    Join Date
    Oct 2013
    Posts
    48
    Thanks
    10
    Thanked 4 Times in 2 Posts
    Quote Originally Posted by Tally View Post
    Christ on a Bike! Not one word of thanks.

    That's it. I am fed up helping people and don't even get a thank you. They use you up and spit you out and never a word of thanks for it. Never again.
    Yes sorry i'm just a big bouchebag. What did i think to not thank you if i didnt even read your post.. That just sucks.. Sorry for that... -.-

    How about this:
    http://killtube.org/showthread.php?1...ull=1#post9431

    or this:
    http://killtube.org/showthread.php?1...ull=1#post7609

    or this:
    http://killtube.org/showthread.php?1...ull=1#post9349

    or this:
    http://killtube.org/showthread.php?1...ull=1#post7589

    or this (even if its not my thread):
    http://killtube.org/showthread.php?1...ull=1#post9368

    I know it sucks if you try to help everyone but no one is saying thanks..
    But you could at least wait for an answer even if your answer solves or doesnt solves the problem.

    So at this point... Just thanks for your help...
    If you wont help me again in the future its ok, its your decision..
    Sorry for my bad english and again sorry for not saying thanks on every post that i dont even read...

  10. #10
    Brigadier General
    Join Date
    Oct 2012
    Posts
    994
    Thanks
    20
    Thanked 588 Times in 388 Posts
    Quote Originally Posted by DjTranceFire View Post
    Yes sorry i'm just a big bouchebag. What did i think to not thank you if i didnt even read your post.. That just sucks.. Sorry for that... -.-

    How about this:
    http://killtube.org/showthread.php?1...ull=1#post9431

    or this:
    http://killtube.org/showthread.php?1...ull=1#post7609

    or this:
    http://killtube.org/showthread.php?1...ull=1#post9349

    or this:
    http://killtube.org/showthread.php?1...ull=1#post7589

    or this (even if its not my thread):
    http://killtube.org/showthread.php?1...ull=1#post9368

    I know it sucks if you try to help everyone but no one is saying thanks..
    But you could at least wait for an answer even if your answer solves or doesnt solves the problem.

    So at this point... Just thanks for your help...
    If you wont help me again in the future its ok, its your decision..
    Sorry for my bad english and again sorry for not saying thanks on every post that i dont even read...
    The very first link you posted - you posted a thank you today as a result of this thread - 5 days after I gave you a piece of code for free. When you cover your ass like that it doesn't count.

    How about this one:

    http://killtube.org/showthread.php?1...able-Viewhands

    No thank you for that one, and I actually did some testing for a couple of hours. So, when it counts - when I go out of my way to do things or give things away - I don't get thanks.

    But you could at least wait for an answer even if your answer solves or doesnt solves the problem.
    I didn't solve your problem with my first post because you didn't explain yourself properly in your first post. I am a modder; not a mind reader. I don't do tricks.

    and again sorry for not saying thanks on every post that i dont even read...
    Pretending to say sorry and then trying to turn it around and make out its the other person's fault, is just so wrong. It actually empties the word "sorry" of all its semantic import. Still, look on the bright side - we wont run into this problem again, because I wont put myself in this position again.

  11. The Following User Says Thank You to Tally For This Useful Post:

    DjTranceFire (12th March 2014)

Posting Permissions

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