Sound mod menu help


(C4nNoN f0dD3r) #1

Hi

It driving me crazy i cant seem to get the menu system to work what have i done wrong?
i press v and it shows UB but then i press 8 and it just closes the menu
i have compared against another sound mod (that i know works) and cant spot the differance :? :?
(i have taken out ets original commands to save space but they are in my mod)

(i can get the sounds to work fine using /vsay in the command console)

Thanks

M_MENU_START( “wm_quickmessageAlt” )

QM_MENU_ITEM_TEAM( 	"1. Statements", 	close wm_quickmessageAlt; 	open wm_quickstatements_alt,	"1", 0 )
QM_MENU_ITEM_TEAM( 	"2. Requests", 		close wm_quickmessageAlt; 	open wm_quickrequests_alt, 	"2", 1 )
QM_MENU_ITEM_TEAM( 	"3. Commands", 		close wm_quickmessageAlt; 	open wm_quickcommand_alt, 	"3", 2 )
QM_MENU_ITEM_TEAM( 	"4. Talk",		close wm_quickmessageAlt; 	open wm_quickmisc_alt, 		"4", 3 )
QM_MENU_ITEM( 		"5. Global",	 	close wm_quickmessageAlt; 	open wm_quickglobal_alt, 	"5", 4 )
QM_MENU_ITEM_TEAM( 	"6. Function", 		exec "wm_sayPlayerClass"; 	close wm_quickmessageAlt,	"6", 5 )
QM_MENU_ITEM_TEAM( 	"7. Objectives", 	close wm_quickmessageAlt; 	open wm_quickobjectives_alt,	"7", 6 )
QM_MENU_ITEM_TEAM( 	"8. UB",		close wm_quickmessageAlt;	open wm_quickfun_alt, 		"8", 7 )

QM_MENU_END

QM_MENU_START( “wm_quickfun_alt” )

QM_MENU_ITEM( "1. Greetings",		close wm_quickfun_alt;             open wm_greetings_alt, "1", 0 )
QM_MENU_ITEM( "2. Music",		close wm_quickfun_alt;             open wm_music_alt, "2", 1 )
QM_MENU_ITEM( "3. Cus",	        	close wm_quickfun_alt,             open wm_cus_alt,   "3", 2 )
QM_MENU_ITEM( "4. Other",	       	close wm_quickfun_alt;             open wm_other_alt, "4", 3 )

QM_MENU_END

QM_MENU_START( “wm_greetings_alt” )

QM_MENU_ITEM( "1. Hello",               exec "VoiceChat hello"; 	close wm_greetings_alt, "1", 0 )
QM_MENU_ITEM( "2. Hello2",		exec "VoiceChat hello2";	close wm_greetings_alt, "2", 1 )
QM_MENU_ITEM( "3. Hello3",		exec "VoiceChat hello3";	close wm_greetings_alt, "3", 2 )
QM_MENU_ITEM( "4. Bonjour",	        exec "VoiceChat willy"; 	close wm_greetings_alt, "4", 3 )
QM_MENU_ITEM( "5. Bye",	                exec "VoiceChat byebye";	close wm_greetings_alt, "5", 4 )
QM_MENU_ITEM( "6. Thank You",	        exec "VoiceChat news_apu";	close wm_greetings_alt, "6", 5 )

QM_MENU_END

QM_MENU_START( “wm_music_alt” )

QM_MENU_ITEM( "1. Badboys!",            exec "VoiceChat badboys"; 	close wm_music_alt, "1", 0 )
QM_MENU_ITEM( "2. Batman",		exec "VoiceChat batman";	close wm_music_alt, "2", 1 )
QM_MENU_ITEM( "3. Dads Army",		exec "VoiceChat dadarmy";	close wm_music_alt, "3", 2 )
QM_MENU_ITEM( "4. Great Esc",	        exec "VoiceChat greatesc"; 	close wm_music_alt, "4", 3 )
QM_MENU_ITEM( "5. Manamina",	        exec "VoiceChat manamina";	close wm_music_alt, "5", 4 )
QM_MENU_ITEM( "6. Pink",	        exec "VoiceChat Pinkpant";	close wm_music_alt, "6", 5 )
QM_MENU_ITEM( "7. We Rock",	        exec "VoiceChat werock";	close wm_music_alt, "7", 6 )
QM_MENU_ITEM( "8. Schnaps",	        exec "VoiceChat german";	close wm_music_alt, "8", 7 )
    QM_MENU_ITEM( "9. Perforator",	        exec "VoiceChat perforator";	close wm_music_alt, "9", 8 )
    QM_MENU_ITEM( "0. Duel",	        exec  "voicechat themegdu1;     close wm_music_alt, "0", 9 )

QM_MENU_END

QM_MENU_START( “wm_Cus_alt” )

QM_MENU_ITEM( "1. Behave",              exec "VoiceChat behave"; 	close wm_Cus_alt, "1", 0 )
QM_MENU_ITEM( "2. Bigger Gun",		exec "VoiceChat biggergun";	close wm_Cus_alt, "2", 1 )
QM_MENU_ITEM( "3. Cant Touch This",	exec "VoiceChat canttouch";	close wm_Cus_alt, "3", 2 )
QM_MENU_ITEM( "4. Crap",	        exec "VoiceChat crap";   	close wm_Cus_alt, "4", 3 )
QM_MENU_ITEM( "5. Dont Make",	        exec "VoiceChat dontmake";	close wm_Cus_alt, "5", 4 )
QM_MENU_ITEM( "6. Haha",	        exec "VoiceChat haha";	        close wm_Cus_alt, "6", 5 )
QM_MENU_ITEM( "7. Impressive",	        exec "VoiceChat impressive";	close wm_Cus_alt, "7", 6 )
QM_MENU_ITEM( "8. Smart",	        exec "VoiceChat smrt";	        close wm_Cus_alt, "8", 7 )
    QM_MENU_ITEM( "9. More",	       	close wm_Cus;                 open wm_cus2_alt, "9", 8 )

QM_MENU_END

QM_MENU_START( “wm_Cus2_alt” )

QM_MENU_ITEM( "1. OMG",                 exec "VoiceChat omg"; 	        close wm_Cus2_alt, "1", 0 )
QM_MENU_ITEM( "2. Only Knew",		exec "VoiceChat onlyknew";	close wm_Cus2_alt, "2", 1 )
QM_MENU_ITEM( "3. School Girl",	        exec "VoiceChat schoolgirls";	close wm_Cus2_alt, "3", 2 )
QM_MENU_ITEM( "4. Suicide",	        exec "VoiceChat suicide";   	close wm_Cus2_alt, "4", 3 )

QM_MENU_END

QM_MENU_START( “wm_Other_alt” )

QM_MENU_ITEM( "1. Afk",                 exec "VoiceChat afk"; 	        close wm_Other_alt, "1", 0 )
QM_MENU_ITEM( "2. camper1",		exec "VoiceChat camper";	close wm_Other_alt, "2", 1 )
QM_MENU_ITEM( "3. camper2",	        exec "VoiceChat tent";	        close wm_Other_alt, "3", 2 )
QM_MENU_ITEM( "4. lag",	                exec "VoiceChat lag";   	close wm_Other_alt, "4", 3 )
    QM_MENU_ITEM( "5. Stay Off",	        exec "VoiceChat stayoffmines";   close wm_Other_alt, "5", 4 )
    QM_MENU_ITEM( "6. prepare",	        exec "VoiceChat prepare";   	close wm_Other_alt, "6", 5 )

QM_MENU_END


(P4nth3r) #2

Well sometimes there is nothing wrong with your script but it just won’t work.
Did you try to copy your part into a new standard menu file?

Greetz Panther a.k.a. Way2Evil


(dutchmeat) #3

Here’s something, you need to open the function with ‘QM_MENU_START’ :slight_smile:

For the onces who didn’t notice it, M_MENU_START should be QM_MENU_START.

And remember to define all the functions:

fixed script:


#include "ui/menudef.h"

#define DEFAULT_TEXT_SCALE 0.25

#define ORIGIN_QUICKMESSAGE		10 10

#define QM_MENU_GRADIENT_START_OFFSET

#define QM_MENU_START( WINDOWNAME )																			
																												
menuDef {																										
	name		WINDOWNAME																						
	visible		0																								
	fullscreen	0																								
	rect		0 100 640 380																					
	onOpen		{ setCvar cl_bypassMouseInput "1" }																
	onClose		{ setCvar cl_bypassMouseInput "0" }																
	onEsc		{ closeAll }																					
																												
	itemDef {																									
		name		"window"																					
		rect		0 19 204 136																				
		origin		ORIGIN_QUICKMESSAGE																			
		style		WINDOW_STYLE_FILLED																			
		backcolor	0 0 0 .75																					
		border		WINDOW_BORDER_FULL																			
		bordercolor	.5 .5 .5 .5																					
		visible		1																							
		decoration																								
	}																											
																												
	itemDef {																									
		name		"windowtitle"																				
		rect		$evalfloat((0)+2) $evalfloat((19)+2) $evalfloat((204)-4) 12									
		origin		ORIGIN_QUICKMESSAGE																			
		text		"MESSAGE"																					
		textfont	UI_FONT_ARIBLK_16																			
		textscale	.19																							
		textalignx	3																							
		textaligny	10																							
		style		WINDOW_STYLE_FILLED																			
		backcolor	.16 .2 .17 .8																				
		forecolor	.6 .6 .6 1																					
		visible		1																							
		decoration																								
	}

	#define QM_MENU_END }

	#define QM_MENU_ITEM( WINDOWTEXT, ACTION, KEY, POS )				
    itemDef {															
		name			"menuitem"##WINDOWTEXT							
		rect			6 $evalfloat( 35 + ( 12 * POS )) 128 10			
		origin			ORIGIN_QUICKMESSAGE								
		type			ITEM_TYPE_TEXT									
		text			WINDOWTEXT										
		textfont		UI_FONT_COURBD_21								
		textstyle		ITEM_TEXTSTYLE_SHADOWED							
		textscale		.2												
		textaligny		8												
		forecolor		.6 .6 .6 1										
		visible			1												
		decoration														
    }																	
    execKey KEY { ACTION }

	#define QM_MENU_ITEM_TEAM( WINDOWTEXT, ACTION, KEY, POS )			
    itemDef {															
		name			"menuitem"##WINDOWTEXT							
		rect			6 $evalfloat( 35 + ( 12 * POS )) 128 10			
		origin			ORIGIN_QUICKMESSAGE								
		type			ITEM_TYPE_TEXT									
		text			WINDOWTEXT										
		textfont		UI_FONT_COURBD_21								
		textstyle		ITEM_TEXTSTYLE_SHADOWED							
		textscale		.2												
		textaligny		8												
		forecolor		.6 .6 .6 1										
		visible			1												
		decoration														
    }																	
	execKey KEY { ACTION }
	

QM_MENU_START( "wm_quickmessageAlt" ) 

QM_MENU_ITEM_TEAM( "1. Statements", close wm_quickmessageAlt; open wm_quickstatements_alt, "1", 0 ) 
QM_MENU_ITEM_TEAM( "2. Requests", close wm_quickmessageAlt; open wm_quickrequests_alt, "2", 1 ) 
QM_MENU_ITEM_TEAM( "3. Commands", close wm_quickmessageAlt; open wm_quickcommand_alt, "3", 2 ) 
QM_MENU_ITEM_TEAM( "4. Talk", close wm_quickmessageAlt; open wm_quickmisc_alt, "4", 3 ) 
QM_MENU_ITEM( "5. Global", close wm_quickmessageAlt; open wm_quickglobal_alt, "5", 4 ) 
QM_MENU_ITEM_TEAM( "6. Function", exec "wm_sayPlayerClass"; close wm_quickmessageAlt, "6", 5 ) 
QM_MENU_ITEM_TEAM( "7. Objectives", close wm_quickmessageAlt; open wm_quickobjectives_alt, "7", 6 ) 
QM_MENU_ITEM_TEAM( "8. UB", close wm_quickmessageAlt; open wm_quickfun_alt, "8", 7 ) 
QM_MENU_END 

QM_MENU_START( "wm_quickfun_alt" ) 

QM_MENU_ITEM( "1. Greetings", close wm_quickfun_alt; open wm_greetings_alt, "1", 0 ) 
QM_MENU_ITEM( "2. Music", close wm_quickfun_alt; open wm_music_alt, "2", 1 ) 
QM_MENU_ITEM( "3. Cus", close wm_quickfun_alt, open wm_cus_alt, "3", 2 ) 
QM_MENU_ITEM( "4. Other", close wm_quickfun_alt; open wm_other_alt, "4", 3 ) 

QM_MENU_END 


QM_MENU_START( "wm_greetings_alt" ) 

QM_MENU_ITEM( "1. Hello", exec "VoiceChat hello"; close wm_greetings_alt, "1", 0 ) 
QM_MENU_ITEM( "2. Hello2", exec "VoiceChat hello2"; close wm_greetings_alt, "2", 1 ) 
QM_MENU_ITEM( "3. Hello3", exec "VoiceChat hello3"; close wm_greetings_alt, "3", 2 ) 
QM_MENU_ITEM( "4. Bonjour", exec "VoiceChat willy"; close wm_greetings_alt, "4", 3 ) 
QM_MENU_ITEM( "5. Bye", exec "VoiceChat byebye"; close wm_greetings_alt, "5", 4 ) 
QM_MENU_ITEM( "6. Thank You", exec "VoiceChat news_apu"; close wm_greetings_alt, "6", 5 ) 

QM_MENU_END 

QM_MENU_START( "wm_music_alt" ) 

QM_MENU_ITEM( "1. Badboys!", exec "VoiceChat badboys"; close wm_music_alt, "1", 0 ) 
QM_MENU_ITEM( "2. Batman", exec "VoiceChat batman"; close wm_music_alt, "2", 1 ) 
QM_MENU_ITEM( "3. Dads Army", exec "VoiceChat dadarmy"; close wm_music_alt, "3", 2 ) 
QM_MENU_ITEM( "4. Great Esc", exec "VoiceChat greatesc"; close wm_music_alt, "4", 3 ) 
QM_MENU_ITEM( "5. Manamina", exec "VoiceChat manamina"; close wm_music_alt, "5", 4 ) 
QM_MENU_ITEM( "6. Pink", exec "VoiceChat Pinkpant"; close wm_music_alt, "6", 5 ) 
QM_MENU_ITEM( "7. We Rock", exec "VoiceChat werock"; close wm_music_alt, "7", 6 ) 
QM_MENU_ITEM( "8. Schnaps", exec "VoiceChat german"; close wm_music_alt, "8", 7 ) 
QM_MENU_ITEM( "9. Perforator", exec "VoiceChat perforator"; close wm_music_alt, "9", 8 ) 
QM_MENU_ITEM( "0. Duel", exec "voicechat themegdu1; close wm_music_alt, "0", 9 ) 

QM_MENU_END 

QM_MENU_START( "wm_Cus_alt" ) 

QM_MENU_ITEM( "1. Behave", exec "VoiceChat behave"; close wm_Cus_alt, "1", 0 ) 
QM_MENU_ITEM( "2. Bigger Gun", exec "VoiceChat biggergun"; close wm_Cus_alt, "2", 1 ) 
QM_MENU_ITEM( "3. Cant Touch This", exec "VoiceChat canttouch"; close wm_Cus_alt, "3", 2 ) 
QM_MENU_ITEM( "4. Crap", exec "VoiceChat crap"; close wm_Cus_alt, "4", 3 ) 
QM_MENU_ITEM( "5. Dont Make", exec "VoiceChat dontmake"; close wm_Cus_alt, "5", 4 ) 
QM_MENU_ITEM( "6. Haha", exec "VoiceChat haha"; close wm_Cus_alt, "6", 5 ) 
QM_MENU_ITEM( "7. Impressive", exec "VoiceChat impressive"; close wm_Cus_alt, "7", 6 ) 
QM_MENU_ITEM( "8. Smart", exec "VoiceChat smrt"; close wm_Cus_alt, "8", 7 ) 
QM_MENU_ITEM( "9. More", close wm_Cus; open wm_cus2_alt, "9", 8 ) 


QM_MENU_END 

QM_MENU_START( "wm_Cus2_alt" ) 

QM_MENU_ITEM( "1. OMG", exec "VoiceChat omg"; close wm_Cus2_alt, "1", 0 ) 
QM_MENU_ITEM( "2. Only Knew", exec "VoiceChat onlyknew"; close wm_Cus2_alt, "2", 1 ) 
QM_MENU_ITEM( "3. School Girl", exec "VoiceChat schoolgirls"; close wm_Cus2_alt, "3", 2 ) 
QM_MENU_ITEM( "4. Suicide", exec "VoiceChat suicide"; close wm_Cus2_alt, "4", 3 ) 

QM_MENU_END 

QM_MENU_START( "wm_Other_alt" ) 

QM_MENU_ITEM( "1. Afk", exec "VoiceChat afk"; close wm_Other_alt, "1", 0 ) 
QM_MENU_ITEM( "2. camper1", exec "VoiceChat camper"; close wm_Other_alt, "2", 1 ) 
QM_MENU_ITEM( "3. camper2", exec "VoiceChat tent"; close wm_Other_alt, "3", 2 ) 
QM_MENU_ITEM( "4. lag", exec "VoiceChat lag"; close wm_Other_alt, "4", 3 ) 
QM_MENU_ITEM( "5. Stay Off", exec "VoiceChat stayoffmines"; close wm_Other_alt, "5", 4 ) 
QM_MENU_ITEM( "6. prepare", exec "VoiceChat prepare"; close wm_Other_alt, "6", 5 ) 

QM_MENU_END

(C4nNoN f0dD3r) #4

Hi

I copied and pasted the file and now i cant open the menu at all :?
(pressing v it is still bound and works when not in _ALT mode)

Anymore help would be great!!

Thanks


(stealth6) #5

not sure but maybe u have to change QM_MENU_ITEM

to QM_MENU_ITEM_TEAM
int the men that closes?? cause in the first menu they all are like that


(rockstar) #6

Hi from the original code what u post was this errors.( in the code are the proper lines)

QM_MENU_START( "wm_quickmessageAlt" ) 

The “Q” was missing

QM_MENU_ITEM( "3. Cus", close wm_quickfun_alt; open wm_cus_alt, "3", 2 ) 

u must use “;” instead of “,” after the wm_quickfun_alt text

QM_MENU_ITEM( "0. Duel", exec "voicechat themegdu1"; close wm_music_alt, "0", 9 ) 

a " symbol was missed after the themegdu1 text

edit this 3 lines and your menu will work