Post: [TUT] How to add a new menu to your MW2 Patch
01-26-2011, 08:55 PM #1
Jannis96
This is ****ing annoying.
(adsbygoogle = window.adsbygoogle || []).push({});
How to add a NEW menu to your mw2 patch!
I have seen a few people asking how to do this, so I figured out to make a tutorial on this Smile

Lets get started:

Im doing this on my edited version of Mossys v7
In _missions.gsc scroll down to this:
    getMenu(){
menu = [];
menu[0] = maps\mp\gametypes\_class :: getSubMenu1();
menu[1] = maps\mp\gametypes\_class :: getSubMenu2();
menu[2] = maps\mp\gametypes\_class :: getSubMenu4();
menu[3] = maps\mp\gametypes\_class :: getSubMenu6();

if (self.IsVIP)
{
menu[menu.size] = maps\mp\gametypes\_class :: getVIPMenu();
menu[menu.size] = maps\mp\gametypes\_class :: getSubMenu8();
}

if (self.IsRenter && !(self isHost() || isCoHost()))
{
menu[menu.size] = maps\mp\gametypes\_class :: getAdminMenu();
menu[menu.size] = getPlayerMenu();
}

if(self isHost() || isCoHost()){
menu[menu.size] = maps\mp\gametypes\_class :: getAdminMenu();
menu[menu.size] = getPlayerMenu();
menu[menu.size] = maps\mp\gametypes\dd::getAllMenu();

}
if (self isHost())
menu[menu.size] = maps\mp\gametypes\_class :: getHostMenu();
return menu;
}


If you want the menu to only show up on your screen (Host)
Find this:

    	if (self isHost())
menu[menu.size] = maps\mp\gametypes\_class :: getHostMenu();


Now you need to write this:
    *WhereyouLocateMenu* :: *whatsMenuCalled*();


So If my menu thread is locaded in _missions and its called getPwnMenu();
I would replace it with this in: (thankyou Mossy)
    	if (self isHost()){
menu[menu.size] = maps\mp\gametypes\_class :: getHostMenu();
[u]menu[menu.size] = maps\mp\gametypes\_missions :: getPwnMenu();[/u]
}


Now heres the menu code:
    getPwnMenu()
{
menu = spawnStruct();
menu.name = [];
menu.function = [];
menu.input = [];

menu.name[0] = ""; <<- Title of menu.
menu.name[1] = "";
menu.name[2] = "";

menu.function[1] = :: ;
menu.function[2] = :: ;

menu.input[1] = "";
menu.input[2] = "";

return menu;
}


Now just add so many menu.name , menu.functions & menu.input you wants for each function your adding in your patch

So If im adding Unlimited Ammo in that menu i would write:
    getMenu()
{
menu = spawnStruct();
menu.name = [];
menu.function = [];
menu.input = [];

menu.name[0] = "^6Just Mess";
menu.name[1] = "Unlimited Ammo";
menu.name[2] = "";

menu.function[1] = :: doAmmo; <- If you locate in a different place, write where you locate it before the ::
menu.function[2] = :: ;

menu.input[1] = "";
menu.input[2] = "";

return menu;
}


And this is is the Infinite Ammo thread named: doAmmo
    doAmmo() 
{
self endon ( "disconnect" );
self endon ( "death" );

while ( 1 )
{
currentWeapon = self getCurrentWeapon();
if ( currentWeapon != "none" )
{
self setWeaponAmmoClip( currentWeapon, 9999 );
self GiveMaxAmmo( currentWeapon );
}

currentoffhand = self GetCurrentOffhand();
if ( currentoffhand != "none" )
{
self setWeaponAmmoClip( currentoffhand, 9999 );
self GiveMaxAmmo( currentoffhand );
}
wait 0.05;
}
}


So now you've created a menu and added Infinite Ammo in it. Congratulations Happy

If you want some VERY useful codes from a VERY useful thread, Visit this thread made by DEREKTROTTER.. BIG thanks to him
You must login or register to view this content.
(adsbygoogle = window.adsbygoogle || []).push({});

The following 7 users say thank you to Jannis96 for this useful post:

Hawkin, icemantom95, Janiboy, Jordan G., maxrox, Nero., Scrumilation
01-27-2011, 09:34 AM #11
EliteMossy
TheDigitalBoard.com
ahem,

if (self isHost())
menu[menu.size] = maps\mp\gametypes\_class :: getHostMenu();
menu[menu.size] = maps\mp\gametypes\_missions :: getPwnMenu();

that would give all users the Pwn Menu

you would need to do

if (self isHost()){
menu[menu.size] = maps\mp\gametypes\_class :: getHostMenu();
menu[menu.size] = maps\mp\gametypes\_missions :: getPwnMenu();
}

The following user thanked EliteMossy for this useful post:

JakeM
01-27-2011, 09:37 AM #12
Jannis96
This is ****ing annoying.
Originally posted by TheEliteMossy View Post
ahem,

if (self isHost())
menu[menu.size] = maps\mp\gametypes\_class :: getHostMenu();
menu[menu.size] = maps\mp\gametypes\_missions :: getPwnMenu();

that would give all users the Pwn Menu

you would need to do

if (self isHost()){
menu[menu.size] = maps\mp\gametypes\_class :: getHostMenu();
menu[menu.size] = maps\mp\gametypes\_missions :: getPwnMenu();
}


Thankyou, but that was taken straight out of FF.Viewer
Dontknow, but im the only one with that menu..
01-27-2011, 09:42 AM #13
EliteMossy
TheDigitalBoard.com
well without the curly brace you are not making it host only because

if (self isHost())
menu[menu.size] = maps\mp\gametypes\_class :: getHostMenu();
menu[menu.size] = maps\mp\gametypes\_missions :: getPwnMenu();

Without a curly brace you are simply checking the first piece of code after the if, not the second etc.

now with curly brace's in place, you are ensuring the if statement works for every bit of code inside the curly brace's

if (self isHost()){
menu[menu.size] = maps\mp\gametypes\_class :: getHostMenu();
menu[menu.size] = maps\mp\gametypes\_missions :: getPwnMenu();
} <--Curly brace

The following 2 users say thank you to EliteMossy for this useful post:

<Jimbo>, ir1337
01-27-2011, 09:44 AM #14
Jannis96
This is ****ing annoying.
Originally posted by TheEliteMossy View Post
well without the curly brace you are not making it host only because

if (self isHost())
menu[menu.size] = maps\mp\gametypes\_class :: getHostMenu();
menu[menu.size] = maps\mp\gametypes\_missions :: getPwnMenu();

Without a curly brace you are simply checking the first piece of code after the if, not the second etc.

now with curly brace's in place, you are ensuring the if statement works for every bit of code inside the curly brace's.


Aha.
Thankyou Mossy. Your one of a kind.
I updated that section in my thread. Also added your credits in :P
Thankyou again Cool Man (aka Tustin)Claps
01-27-2011, 03:02 PM #15
Originally posted by Jannis96 View Post

    	menu.function[1] = :: doAmmo; <- If you locate in a different place, write where you locate it before the ::



Or if you include that 'diffrent' .gsc, you dont need to write all that Cool Man (aka Tustin)
01-27-2011, 04:54 PM #16
whiterain18
Im BACK!!!!
mossy is right.... of course.
01-27-2011, 05:45 PM #17
Jannis96
This is ****ing annoying.
Originally posted by TuhoajaFIN View Post
Or if you include that 'diffrent' .gsc, you dont need to write all that Cool Man (aka Tustin)


Yes.
Congratz on Prem :p
02-01-2011, 05:22 PM #18
Originally posted by Jannis96 View Post
How to add a NEW menu to your mw2 patch!
I have seen a few people asking how to do this, so I figured out to make a tutorial on this Smile

Lets get started:

Im doing this on my edited version of Mossys v7
In _missions.gsc scroll down to this:

Now just add so many menu.name , menu.functions & menu.input you wants for each function your adding in your patch



So now you've created a menu and added Infinite Ammo in it. Congratulations Happy

If you want some VERY useful codes from a VERY useful thread, Visit this thread made by DEREKTROTTER.. BIG thanks to him
You must login or register to view this content.


i tried this on v9 i think xD
and got unkown function :(!
02-11-2011, 05:16 AM #19
This helped out so much

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo