Login x
User Name:
Password:
Social Links Facebook Twitter YouTube Steam RSS News Feeds

Members Online

»
0 Active | 51 Guests
Online:

LATEST FORUM THREADS

»
CoD: Battle Royale
CoD+UO Map + Mod Releases
Damaged .pk3's
CoD Mapping
heli to attack ai
CoD4 SP Mapping

Forums

»

Welcome to the MODSonline.com forums. Looking for Frequently Asked Questions? Check out our FAQs section or search it out using the SEARCH link below. If you are new here, you may want to check out our rules and this great user's guide to the forums and the website.
For more mapping and modding information, see our Wiki: MODSonWiki.com

Jump To:
Forum: All Forums : Call of Duty 2
Category: CoD2 Scripting
Scripting and coding with Call of Duty 2.
Moderators: foyleman, Foxhound, Mystic, StrYdeR, batistablr, Welshy, DrBiggzz, supersword, playername
Latest Posts
Subscribed Posts
Search
Restricted Access Topic is Locked subscribe
Author Topic: musicmenu problem
extreem515
General Member
Since: Jul 8, 2011
Posts: 34
Last: Apr 4, 2014
[view latest posts]
Level 2
Im a fan of MODSonair
Category: CoD2 Scripting
Posted: Wednesday, Sep. 21, 2011 06:42 pm
It is my musicmenu (hunters shop):
#include "ui_mp/menudef.h"

#define ORIGIN_QUICKMESSAGETAB 32 224
#define ORIGIN_QUICKMESSAGEWINDOW 32 256

{
menuDef
{
name "musicmenu"
fullscreen 0
rect 0 0 640 480
focuscolor 1 1 1 1
disablecolor 0 0 0 0
style WINDOW_STYLE_EMPTY

onOpen
{
setDvar cl_bypassMouseInput "1"
}
onClose
{
setDvar cl_bypassMouseInput "0"
}

// WINDOW BACKGROUND
itemDef
{
name "window_background"
visible 1
rect 0 0 224 192
origin ORIGIN_QUICKMESSAGEWINDOW
style WINDOW_STYLE_FILLED
forecolor 1 1 1 1
backcolor 0 0 0 0.7975
decoration
}

// WINDOW LINES
itemDef
{
name "window_lines"
visible 1
rect 3 0 2 187
origin ORIGIN_QUICKMESSAGEWINDOW
style WINDOW_STYLE_FILLED
backcolor 1 1 1 .125
decoration
}
itemDef
{
name "window_lines"
visible 1
rect 219 0 2 187
origin ORIGIN_QUICKMESSAGEWINDOW
style WINDOW_STYLE_FILLED
backcolor 1 1 1 .125
decoration
}
itemDef
{
name "window_lines"
visible 1
rect 5 0 214 2
origin ORIGIN_QUICKMESSAGEWINDOW
style WINDOW_STYLE_FILLED
backcolor 1 1 1 .125
decoration
}
itemDef
{
name "window_lines"
visible 1
rect 3 187 218 2
origin ORIGIN_QUICKMESSAGEWINDOW
style WINDOW_STYLE_FILLED
backcolor 1 1 1 .125
decoration
}

// TITLE
itemDef
{
name "title"
visible 1
rect 0 0 224 32
origin ORIGIN_QUICKMESSAGETAB
style WINDOW_STYLE_FILLED
forecolor 1 1 1 1
backcolor 0 0 0 0.7975
type ITEM_TYPE_TEXT
text "@QUICKMESSAGE_QUICK_MESSAGE"
textfont UI_FONT_NORMAL
textscale .24
textalignx 112
textaligny 24
textalign ITEM_ALIGN_CENTER
decoration
}
itemDef
{
name "title_quickmessage_gray"
visible 1
rect 3 3 218 29
origin ORIGIN_QUICKMESSAGETAB
style WINDOW_STYLE_FILLED
backcolor 1 1 1 .125
decoration
}

itemDef
{
name "window"
group ingamebox
visible 1
rect 16 20 0 0
origin ORIGIN_QUICKMESSAGEWINDOW
forecolor 1 1 1 1
textfont UI_FONT_NORMAL
textscale .24
textaligny 8
text "^2#^3Hunters shop^2#"
decoration
}


itemDef
{
name "window"
group ingamebox
visible 1
rect 16 36 0 0
origin ORIGIN_QUICKMESSAGEWINDOW
forecolor 1 1 1 1
textfont UI_FONT_NORMAL
textscale .24
textaligny 8
text "^2#^11.^9God Mode^1-^32000$^2#"
decoration
}
execKey "1" { scriptmenuresponse "narkota"; close musicmenu }

itemDef
{
name "window"
group ingamebox
visible 1
rect 16 52 0 0
origin ORIGIN_QUICKMESSAGEWINDOW
forecolor 1 1 1 1
textfont UI_FONT_NORMAL
textscale .24
textaligny 8
text "^2#^12.^93 Bombs^1-^3300$^2#"
decoration
}
execKey "2" { scriptmenuresponse "fraggrenade"; close musicmenu }

itemDef
{
name "window"
group ingamebox
visible 1
rect 16 68 0 0
origin ORIGIN_QUICKMESSAGEWINDOW
forecolor 1 1 1 1
textfont UI_FONT_NORMAL
textscale .24
textaligny 8
text "^2#^13.^93 Grenades^1-^3500$^2#"
decoration
}
execKey "3" { scriptmenuresponse "grenades"; close musicmenu }

itemDef
{
name "window"
group ingamebox
visible 1
rect 16 84 0 0
origin ORIGIN_QUICKMESSAGEWINDOW
forecolor 1 1 1 1
textfont UI_FONT_NORMAL
textscale .24
textaligny 8
text "^2#^14.^9Mina^1-^3300$^2#"
decoration
}
execKey "4" { scriptmenuresponse "ammo"; close musicmenu }

itemDef
{
name "window"
group ingamebox
visible 1
rect 16 100 0 0
origin ORIGIN_QUICKMESSAGEWINDOW
forecolor 1 1 1 1
textfont UI_FONT_NORMAL
textscale .24
textaligny 8
text "^2#^15.^9Ammo 2 weapon^1-^3750$^2#"
decoration
}
execKey "5" { scriptmenuresponse "ammomain"; close musicmenu }

itemDef
{
name "window"
group ingamebox
visible 1
rect 16 116 0 0
origin ORIGIN_QUICKMESSAGEWINDOW
forecolor 1 1 1 1
textfont UI_FONT_NORMAL
textscale .24
textaligny 8
text "^2#^16.^9Bazooka^1-^31200$^2#"
decoration
}
execKey "6" { scriptMenuResponse "bazooka"; close musicmenu }

itemDef
{
name "window"
group ingamebox
visible 1
rect 16 132 0 0
origin ORIGIN_QUICKMESSAGEWINDOW
forecolor 1 1 1 1
textfont UI_FONT_NORMAL
textscale .24
textaligny 8
text "^2#^17.^9Airkill^1-^33000$^2#"
decoration
}
execKey "7" { scriptMenuResponse "airkill"; close musicmenu }

itemDef
{
name "window"
visible 1
rect 16 148 0 0
origin ORIGIN_QUICKMESSAGEWINDOW
forecolor 1 1 1 1
textfont UI_FONT_NORMAL
textscale .24
textaligny 8
text "@QUICKMESSAGE_ESC_EXIT"
decoration
}
}
}





Red


When I pressed key 4,5,6,7 ,scriptmenuresponse is not working. Why??
I pess 6 musicmenu is close but scriptmenu not open bazooka.
Share |
liltc64
General Member
Since: Feb 12, 2007
Posts: 906
Last: Oct 22, 2012
[view latest posts]
Level 7
Im a fan of MODSonair
Category: CoD2 Scripting
Posted: Wednesday, Sep. 21, 2011 08:58 pm
from what i see i dont see anything. maybe you didnt precache the menu? go on cod2 type in /developer 1. start up your mod open up console and you will find your menu error in there [rolleyes].
Share |
extreem515
General Member
Since: Jul 8, 2011
Posts: 34
Last: Apr 4, 2014
[view latest posts]
Level 2
Im a fan of MODSonair
Category: CoD2 Scripting
Posted: Friday, Sep. 23, 2011 06:24 pm
init()
{
game["menu_musicmenu"] = "musicmenu";
game["menu_musicmenu2"] = "musicmenu2";
game["menu_musicmenu3"] = "musicmenu3";
game["menu_musicmenu4"] = "musicmenu4";

precacheMenu(game["menu_musicmenu"]);
precacheMenu(game["menu_musicmenu2"]);
precacheMenu(game["menu_musicmenu3"]);
precacheMenu(game["menu_musicmenu4"]);
precacheHeadIcon("talkingicon");
}



musicmenu(response)
(...)



I have this all.
Share |
IzNoGoD
General Member
Since: Nov 29, 2008
Posts: 694
Last: Nov 10, 2012
[view latest posts]
Level 6
Category: CoD2 Scripting
Posted: Friday, Sep. 23, 2011 06:31 pm
Did you edit menus.gsc to pass on the menu notify?
Share |
extreem515
General Member
Since: Jul 8, 2011
Posts: 34
Last: Apr 4, 2014
[view latest posts]
Level 2
Im a fan of MODSonair
Category: CoD2 Scripting
Posted: Saturday, Sep. 24, 2011 10:50 am
init()
{
game["menu_ingame"] = "ingame";
game["menu_team"] = "menu_team";
game["menu_weapon_allies"] = "weapon";
game["menu_weapon_axis"] = "weapon";

precacheMenu(game["menu_ingame"]);
precacheMenu(game["menu_team"]);
precacheMenu(game["menu_weapon_allies"]);
precacheMenu(game["menu_weapon_axis"]);
precacheMenu(game["menu_playercontrols"]);
precacheMenu(game["menu_musicmenu"]);
precacheMenu(game["menu_musicmenu2"]);
precacheMenu(game["menu_musicmenu3"]);
precacheMenu(game["menu_musicmenu4"]);
precacheMenu(game["menu_money"]);
precacheMenu(game["menu_hz"]);


if(!level.xenon)
{
game["menu_callvote"] = "callvote";
game["menu_muteplayer"] = "muteplayer";

precacheMenu(game["menu_callvote"]);
precacheMenu(game["menu_muteplayer"]);
}
else
{
level.splitscreen = isSplitScreen();
if(level.splitscreen)
{
game["menu_team"] += "_splitscreen";
game["menu_weapon_allies"] += "_splitscreen";
game["menu_weapon_axis"] += "_splitscreen";
game["menu_ingame_onteam"] = "ingame_onteam_splitscreen";
game["menu_ingame_spectator"] = "ingame_spectator_splitscreen";

precacheMenu(game["menu_team"]);
precacheMenu(game["menu_weapon_allies"]);
precacheMenu(game["menu_weapon_axis"]);
precacheMenu(game["menu_ingame_onteam"]);
precacheMenu(game["menu_ingame_spectator"]);
precacheMenu(game["menu_playercontrols"]);
precacheMenu(game["menu_musicmenu"]);
precacheMenu(game["menu_musicmenu2"]);
precacheMenu(game["menu_musicmenu3"]);
precacheMenu(game["menu_musicmenu4"]);
precacheMenu(game["menu_money"]);
precacheMenu(game["menu_hz"]);
game["menu_playercontrols"] = "playercontrols";
}
}

level thread onPlayerConnect();
}

onPlayerConnect()
{
for(;;)
{
level waittill("connecting", player);
player thread onMenuResponse();
}
}

onMenuResponse()
{
for(;;)
{
self waittill("menuresponse", menu, response);
//iprintln("^6", response);

if(response == "back")
{
self closeMenu();
self closeInGameMenu();

if(menu == game["menu_team"])
{
if(level.splitscreen)
{
if(self.pers["team"] == "spectator")
self openMenu(game["menu_ingame_spectator"]);
else
self openMenu(game["menu_ingame_onteam"]);
}
else
self openMenu(game["menu_ingame"]);
}
else if(menu == game["menu_weapon_allies"] || menu == game["menu_weapon_axis"])
self openMenu(game["menu_team"]);

continue;
}

if(response == "endgame")
{
if(level.splitscreen)
level thread [[level.endgameconfirmed]]();

continue;
}

if(menu == game["menu_ingame"] || (level.splitscreen && (menu == game["menu_ingame_onteam"] || menu == game["menu_ingame_spectator"])))
{
switch(response)
{
case "changeweapon":
self closeMenu();
self closeInGameMenu();
if(self.pers["team"] == "allies")
self openMenu(game["menu_weapon_allies"]);
else if(self.pers["team"] == "axis")
self openMenu(game["menu_weapon_axis"]);
break;

case "changeteam":
self closeMenu();
self closeInGameMenu();
self openMenu(game["menu_team"]);
break;

case "muteplayer":
if(!level.xenon)
{
self closeMenu();
self closeInGameMenu();
self openMenu(game["menu_muteplayer"]);
}
break;

case "callvote":
if(!level.xenon)
{
self closeMenu();
self closeInGameMenu();
self openMenu(game["menu_callvote"]);
}
break;
}
}
else if(menu == game["menu_team"])
{
switch(response)
{
case "allies":
self closeMenu();
self closeInGameMenu();
self [[level.allies]]();
break;

case "axis":
self closeMenu();
self closeInGameMenu();
self [[level.axis]]();
break;

case "autoassign":
self closeMenu();
self closeInGameMenu();
self [[level.autoassign]]();
break;

case "spectator":
self closeMenu();
self closeInGameMenu();
self [[level.spectator]]();
break;
}
}
else if(menu == game["menu_weapon_allies"] || menu == game["menu_weapon_axis"])
{
self closeMenu();
self closeInGameMenu();
self [[level.weapon]](response);
}
else if(!level.xenon)
{
///////////////////////quickmessages/////////////////////////////////

if(menu == game["menu_quickcommands"])
huntyaudobriy\_quickmessages::quickcommands(response);
else if(menu == game["menu_quickstatements"])
huntyaudobriy\_quickmessages::quickstatements(response);
else if(menu == game["menu_quickresponses"])
huntyaudobriy\_quickmessages::quickresponses(response);

////////////////////shop/////////////////////////////////////////////

else if(menu == game["menu_musicmenu"])
huntyaudobriy\_shop::musicmenu(response);
else if(menu == game["menu_musicmenu2"])
huntyaudobriy\_shop::musicmenu2(response);
else if(menu == game["menu_musicmenu3"])
huntyaudobriy\_shop::musicmenu3(response);
else if(menu == game["menu_musicmenu4"])
huntyaudobriy\_shop::musicmenu4(response);

////////////////////givemoney////////////////////////////////

else if(menu == game["menu_money"])
huntyaudobriy\_givemoney::money(response);

////////////////////miniadmin///////////////////////////////

else if(menu == game["menu_hz"])
huntyaudobriy\_miniadmin::hz(response);


if(response == "thirdperson")
{
thirdpersonOn = undefined;

if(!isdefined(self.thirdperson))
{
self.thirdperson = false;
}

if(self.thirdperson)
{
self.thirdperson = false;
self setclientcvar("cg_thirdperson", 0);
}
else
{
self.thirdperson = true;
self setclientcvar("cg_thirdperson", 1);
}
}

}
}
}
Share |
extreem515
General Member
Since: Jul 8, 2011
Posts: 34
Last: Apr 4, 2014
[view latest posts]
Level 2
Im a fan of MODSonair
Category: CoD2 Scripting
Posted: Saturday, Sep. 24, 2011 10:57 am
Must i add to line mucimenu (in shop.gsc) response from musicmenu2? bacause i edited musicmenu.menu and add options from musicmenu2.menu
Share |
Restricted Access Topic is Locked subscribe
MODSonline.com Forums : Call of Duty 2 : CoD2 Scripting

Latest Syndicated News

»
Codutility.com up and runn...
Nice, and there still using the logo and template for the screenshots, which...
Codutility.com up and runn...
dundy writes...Quote:Call of Duty modding and mapping is barly alive only a ...
Codutility.com up and runn...
Mystic writes...Quote:It seems to me the like the site is completely dead? ...
Codutility.com up and runn...
It seems to me the like the site is completely dead?

Partners & Friends

»