PDA

View Full Version : [CoD4] Disable Select Class



DjTranceFire
12th March 2014, 12:23
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

scriptMenuResponse "allies";

_menus.gsc:



case "allies":
self [[level.allies]]();
break;


Where is the part that opens the choose class menu?

Sorry for my bad english! :x

Tally
12th March 2014, 12:58
You are looking at the wrong menu. look in raw/ui_mp/scriptments/class.menu and edit it like this:


#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:


menufile,ui_mp/scriptmenus/class.menu

In your server config file, set the dvar:


set scr_force_class "1"

The class button will appear greyed out and they wont be able to click it.

DjTranceFire
12th March 2014, 13:54
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.

Tally
12th March 2014, 14:10
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?

DjTranceFire
12th March 2014, 14:13
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.

Tally
12th March 2014, 14:15
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.

Tally
12th March 2014, 15:38
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.

YuriJurek
12th March 2014, 15:59
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!

DjTranceFire
12th March 2014, 20:18
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?1858-CoD4-Menu-Player-Counter&p=9431&viewfull=1#post9431

or this:
http://killtube.org/showthread.php?1628-Keyboard-in-Hud&p=7609&viewfull=1#post7609

or this:
http://killtube.org/showthread.php?1854-CoD4-Custom-Health-Bar&p=9349&viewfull=1#post9349

or this:
http://killtube.org/showthread.php?1627-Show-Jump-Distance&p=7589&viewfull=1#post7589

or this (even if its not my thread):
http://killtube.org/showthread.php?1857-CoD4-Disable-Viewhands&p=9368&viewfull=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...

Tally
12th March 2014, 21:38
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?1858-CoD4-Menu-Player-Counter&p=9431&viewfull=1#post9431

or this:
http://killtube.org/showthread.php?1628-Keyboard-in-Hud&p=7609&viewfull=1#post7609

or this:
http://killtube.org/showthread.php?1854-CoD4-Custom-Health-Bar&p=9349&viewfull=1#post9349

or this:
http://killtube.org/showthread.php?1627-Show-Jump-Distance&p=7589&viewfull=1#post7589

or this (even if its not my thread):
http://killtube.org/showthread.php?1857-CoD4-Disable-Viewhands&p=9368&viewfull=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?1857-CoD4-Disable-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.

DjTranceFire
12th March 2014, 22:09
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.


I am a modder; not a mind reader.

So you cant know that i first answerd that post BEFOR i read THIS one?
Anyways...



How about this one:

http://killtube.org/showthread.php?1857-CoD4-Disable-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.


I already linked this thread and if you look all the posts you will find a thank you from me, even if its not my thread!
Sorry that i dont said thank you again after you testet it and got some new answers but i dont opend the post again because its not my thread.




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.


Dont understand me wrong, i wont say that its wrong to not solve problems on the first try.
I'm thankful anyways for every help even if its not going to solve my problem.
No one is perfect and sometimes a answer just dont helps.. That not the problem!



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.

Thats the one and only reason for my post!
I just dont understand why someone has to cry about another one not saying "thank you" even if the person doesnt even reads the post.
On "03:15 PM" you got a new answer on this thread. I still dont know if its going to help me because i still doesnt tested it.
Without any response from me you created a new post at "04:38 PM" (only 1 hour later) crying because i'm not saying "thank you"
How should i? I'm not online for hours!

As i said.. If you dont want to help me again its ok.. In this case: kkthxbb <3 and thank you for your help in the past..
But ofc it would be awesome if you still woud help other users in this board.
Not everyone is a douchebag like me..

Thank you for your help! ;)

//edit:
Oh and btw.. You have "386 Thanks in 252 Posts" and that doesnt even count if someone just write it instead of just pressing buttons.
For that reason i dont think that your statement that no one is saying "Thank you" is going to be right but thats just my opinion..