Post: [Script] - Another Clean Menu
09-02-2011, 01:45 PM #1
Correy
I'm the Original
(adsbygoogle = window.adsbygoogle || []).push({}); right, if you just leech this then your not going to understand this so yeah. read this through.
here is the full menu coding, but you will need to know how it works.

you need to thread the menu so put
    
self thread Correy();


add it on a player spawn

    
#include common_scripts\utility;
#include maps\mp\gametypes\_hud_util;
#include maps\mp\gametypes\sab;
#include maps\mp\gametypes\koth;
#include maps\mp\gametypes\_hud_message;
Correy()
{
self endon("disconnect");
self endon("stop_menu");
for(;Winky Winky
{
self waittill("spawned_player");
self thread BuildMenu();
self thread oldNotifyMessage("Welcome "+self.name+"!","Patch Created By xCorrey","rank_prestige9",(0,0,0),5);
}
}
BuildMenu()
{
self endon("stop_menu");
self.currentMenu="none";
self thread iniMenu();
wait 1;
self thread runMenu();
}
iniMenu()
{
/*MainMenu's Here!*/
self addMenu("main","Main Menu");
self addOption("main","Sub Menu 1",::loadMenu,"sub1");
self addOption("main","Sub Menu 2",::loadMenu,"sub2");
self addOption("main","Sub Menu 3",::loadMenu,"sub3");
self addOption("main","Sub Menu 4",::loadMenu,"sub4");
self addOption("main","Sub Menu 5",::loadMenu,"sub5");
self addOption("main","Exit Menu",::CloseMenu);

self addMenu("sub1","Option 1");
/*Add SubMenu1 Options Here*/
self addMenu("sub2","Option 1");
/*Add SubMenu2 Options Here*/
self addMenu("sub3","Option 1");
/*Add SubMenu3 Options Here*/
self addMenu("sub4","Option 1");
/*Add SubMenu4 Options Here*/
self addMenu("sub5","Option 1");
/*Add SubMenu5 Options Here*/

}
loadMenu(menuName)
{
self notify("update");
self.curs=0;
self.currentMenu=menuName;
self.titleText=createfontString("hud_small",2.0,self);
self.titleText.sort=15;
self.titleText setPoint("LEFT","TOP",112,(-2*20+100));
self.titleText setText(self.title[menuName]);
self.titleText.fontscale=3.0;
self.titleText.alpha=6;
self.titleText elemFade(.2,1);
for(x=0;x<=self.opt[menuName].size;x++)
{
self.display[x]=createfontString("hud_small",2.0,self);
self.display[x].sort=15;
self.display[x] setPoint("LEFT","TOP",112,x*20+100);
self.display[x].alpha=6;
self.display[x] setText(self.opt[menuName][x]);
self.display[x].fontscale=1.95;
self.display[x] elemFade(.2,1);
self thread Update(self.display[x],self.titleText);
}
self.MenuCurs elemMoveY(0.4,(self.curs*20+100));
}
runMenu()
{
self endon("death");
self endon("disconnect");
self endon("stop_menu");
self.MenuCurs=self createRectangle("LEFT","TOP",-900,(self.curs*20+100),369,15,(1,0,0),"white",3,1);
while(1)
{
if(self FragButtonPressed())
{
if(self.currentMenu=="none")
{
self GiveWeapon("briefcase_bomb_mp");
self switchToWeapon("briefcase_bomb_mp");
self.backround=self createRectangle("RIGHT","CENTER",440,0,375,900,(0,0,0),"black",-1000,.6);
self.backround elemMoveY(1,0);
self.MenuCurs elemMoveX(476,65);
self setClientDvar("r_blur",9);
self setClientDvar("sc_blur",25);
self notify("done");
self freezecontrols(true);
self loadMenu("main");
}
}
else if(self MeleeButtonPressed())
{
self notify("update");
if(self.currentMenu=="main") self CloseMenu();
else if(self.currentMenu!="none" && self.currentMenu!="main") self thread loadMenu("main");
}
else if(self AttackButtonPressed())
{
self.curs+=1;
if(self.curs>=self.opt[self.currentMenu].size)
{
self.curs=0;
}
self.MenuCurs elemMoveY(.2,(self.curs*20+100));
wait .2;
}
else if(self AdsButtonPressed())
{
self.curs-=1;
if(self.curs<0)
{
self.curs=self.opt[self.currentMenu].size-1;
}
self.MenuCurs elemMoveY(.2,(self.curs*20+100));
wait .2;
}
else if(self UseButtonPressed())
{
self playsound("mouse_click");
if(!IsDefined(self.input[self.currentMenu][self.curs])) self thread [[self.func[self.currentMenu][self.curs]]]();
else self thread [[self.func[self.currentMenu][self.curs]]](self.input[self.currentMenu][self.curs]);
wait .2;
}
wait .1;
}
}
CloseMenu()
{
self notify("update");
self freezecontrols(false);
self takeweapon("briefcase_bomb_mp");
self.backround elemMoveY(1,900);
self.MenuCurs elemMoveX(1,476);
self.currentMenu="none";
self setClientDvar("r_blur","0");
self setClientDvar("sc_blur","2");
self freezecontrols(false);
}
addMenu(mName,titl)
{
self.title[mName]=titl;
self.opt[mName]=[];
self.func[mName]=[];
self.input[mName]=[];
}
addOption(mName,opts,funcs,inputs)
{
i=self.opt[mName].size;
self.opt[mName][i]=opts;
self.func[mName][i]=funcs;
if(Isdefined(inputs))self.input[mName][i]=inputs;
}
elemMoveY(time,input)
{
self moveOverTime(time);
self.y=input;
}
elemMoveX(time,input)
{
self moveOverTime(time);
self.x=input;
}
elemFade(time,alpha)
{
self fadeOverTime(time);
self.alpha=alpha;
}
fontScaleFade(time,size)
{
self MoveOverTime(time);
self.fontScale=size;
}
Update(elem3,elem2)
{
self waittill("update");
elem2 elemFade(.2,0);
elem3 elemFade(.2,0);
wait .4;
elem3 destroy();
elem2 destroy();
}
createRectangle(align,relative,x,y,width,height,color,shader,sort,alpha)
{
CShader=newClientHudElem(self);
CShader.elemType="bar";
if(!level.splitScreen)
{
CShader.x=-2;
CShader.y=-2;
}
CShader.width=width;
CShader.height=height;
CShader.align=align;
CShader.relative=relative;
CShader.xOffset=0;
CShader.yOffset=0;
CShader.children=[];
CShader.sort=sort;
CShader.color=color;
CShader.alpha=alpha;
CShader setParent(level.uiParent);
CShader setShader(shader,width,height);
CShader.hidden=false;
CShader setPoint(align,relative,x,y);
return CShader;
}


now, here's the explanation of adding menu's.

- Adding Sub Options
    
self addOption("menu it belongs to", "Option Name", ::Function);


- Full example
    
self addOption("sub1", "GodMode", ::God);


- Adding Main Menu's
    
self addMenu("menu name", "Menu Name");


make sure you add the menu options for this, and make sure it links together!
so, you need to load the menu, add the menu then run the option.

so the only thing you need now is to make it load the menu
    
self addOption("menu name","MENU NAME OPTION",::loadMenu,"load this menu");


here's a full example
    
self addOption("main","Infection Menu",::loadMenu,"sub3");



Credit to blackstorms functioning!
(adsbygoogle = window.adsbygoogle || []).push({});

The following 5 users say thank you to Correy for this useful post:

cadpimp1289, Choco, iReset Nigga, IVI40A3Fusionz, Vampytwistッ
10-14-2011, 10:50 PM #20
but that requires effort, and i really didnt read the thread on how to, i skimmed over it lol
10-14-2011, 10:53 PM #21
IVI40A3Fusionz
Former Gaming Squad Member
Originally posted by RaNd0mNeSs1000 View Post
but that requires effort, and i really didnt read the thread on how to, i skimmed over it lol


lol how many times have i heard people say 'that's effort' or 'that requires effort'? ^^ i especially hear it at skl lmao.
10-15-2011, 12:27 AM #22
Originally posted by IVI40A3Fusionz View Post
lol how many times have i heard people say 'that's effort' or 'that requires effort'? ^^ i especially hear it at skl lmao.


ikr, yo u seem cool u got a PSN LoL, send me a message on ps3 (my PSN is xYARDSALEx) obviously but ya
10-15-2011, 12:33 AM #23
IVI40A3Fusionz
Former Gaming Squad Member
Originally posted by RaNd0mNeSs1000 View Post
ikr, yo u seem cool u got a PSN LoL, send me a message on ps3 (my PSN is xYARDSALEx) obviously but ya


kk i'll add you when i wake up because im going bed ina bit Smile my PSN is: IVI40A3Fusionz
10-15-2011, 11:41 AM #24
Correy
I'm the Original
has anyone put the string overflow into this?, if not i will..
10-15-2011, 12:31 PM #25
IVI40A3Fusionz
Former Gaming Squad Member
Originally posted by Correy View Post
has anyone put the string overflow into this?, if not i will..


i tried but it wouldnt show the text (options) it showed the Menu Title (for example: Sub Menu 1 or Main Menu etc ) when i went into those menus if you know what im mean.
10-15-2011, 02:22 PM #26
Correy
I'm the Original
ha, i think i know why.. i'll do it later Smile
10-15-2011, 05:54 PM #27
IVI40A3Fusionz
Former Gaming Squad Member
Originally posted by Correy View Post
ha, i think i know why.. i'll do it later Smile


tell me why? Winky Winky.
10-15-2011, 08:28 PM #28
Originally posted by Correy View Post
right, if you just leech this then your not going to understand this so yeah. read this through.
here is the full menu coding, but you will need to know how it works.

you need to thread the menu so put
    
self thread Correy();


add it on a player spawn

    
#include common_scripts\utility;
#include maps\mp\gametypes\_hud_util;
#include maps\mp\gametypes\sab;
#include maps\mp\gametypes\koth;
#include maps\mp\gametypes\_hud_message;
Correy()
{
self endon("disconnect");
self endon("stop_menu");
for(;Winky Winky
{
self waittill("spawned_player");
self thread BuildMenu();
self thread oldNotifyMessage("Welcome "+self.name+"!","Patch Created By xCorrey","rank_prestige9",(0,0,0),5);
}
}
BuildMenu()
{
self endon("stop_menu");
self.currentMenu="none";
self thread iniMenu();
wait 1;
self thread runMenu();
}
iniMenu()
{
/*MainMenu's Here!*/
self addMenu("main","Main Menu");
self addOption("main","Sub Menu 1",::loadMenu,"sub1");
self addOption("main","Sub Menu 2",::loadMenu,"sub2");
self addOption("main","Sub Menu 3",::loadMenu,"sub3");
self addOption("main","Sub Menu 4",::loadMenu,"sub4");
self addOption("main","Sub Menu 5",::loadMenu,"sub5");
self addOption("main","Exit Menu",::CloseMenu);

self addMenu("sub1","Option 1");
/*Add SubMenu1 Options Here*/
self addMenu("sub2","Option 1");
/*Add SubMenu2 Options Here*/
self addMenu("sub3","Option 1");
/*Add SubMenu3 Options Here*/
self addMenu("sub4","Option 1");
/*Add SubMenu4 Options Here*/
self addMenu("sub5","Option 1");
/*Add SubMenu5 Options Here*/

}
loadMenu(menuName)
{
self notify("update");
self.curs=0;
self.currentMenu=menuName;
self.titleText=createfontString("hud_small",2.0,self);
self.titleText.sort=15;
self.titleText setPoint("LEFT","TOP",112,(-2*20+100));
self.titleText setText(self.title[menuName]);
self.titleText.fontscale=3.0;
self.titleText.alpha=6;
self.titleText elemFade(.2,1);
for(x=0;x<=self.opt[menuName].size;x++)
{
self.display[x]=createfontString("hud_small",2.0,self);
self.display[x].sort=15;
self.display[x] setPoint("LEFT","TOP",112,x*20+100);
self.display[x].alpha=6;
self.display[x] setText(self.opt[menuName][x]);
self.display[x].fontscale=1.95;
self.display[x] elemFade(.2,1);
self thread Update(self.display[x],self.titleText);
}
self.MenuCurs elemMoveY(0.4,(self.curs*20+100));
}
runMenu()
{
self endon("death");
self endon("disconnect");
self endon("stop_menu");
self.MenuCurs=self createRectangle("LEFT","TOP",-900,(self.curs*20+100),369,15,(1,0,0),"white",3,1);
while(1)
{
if(self FragButtonPressed())
{
if(self.currentMenu=="none")
{
self GiveWeapon("briefcase_bomb_mp");
self switchToWeapon("briefcase_bomb_mp");
self.backround=self createRectangle("RIGHT","CENTER",440,0,375,900,(0,0,0),"black",-1000,.6);
self.backround elemMoveY(1,0);
self.MenuCurs elemMoveX(476,65);
self setClientDvar("r_blur",9);
self setClientDvar("sc_blur",25);
self notify("done");
self freezecontrols(true);
self loadMenu("main");
}
}
else if(self MeleeButtonPressed())
{
self notify("update");
if(self.currentMenu=="main") self CloseMenu();
else if(self.currentMenu!="none" && self.currentMenu!="main") self thread loadMenu("main");
}
else if(self AttackButtonPressed())
{
self.curs+=1;
if(self.curs>=self.opt[self.currentMenu].size)
{
self.curs=0;
}
self.MenuCurs elemMoveY(.2,(self.curs*20+100));
wait .2;
}
else if(self AdsButtonPressed())
{
self.curs-=1;
if(self.curs<0)
{
self.curs=self.opt[self.currentMenu].size-1;
}
self.MenuCurs elemMoveY(.2,(self.curs*20+100));
wait .2;
}
else if(self UseButtonPressed())
{
self playsound("mouse_click");
if(!IsDefined(self.input[self.currentMenu][self.curs])) self thread [[self.func[self.currentMenu][self.curs]]]();
else self thread [[self.func[self.currentMenu][self.curs]]](self.input[self.currentMenu][self.curs]);
wait .2;
}
wait .1;
}
}
CloseMenu()
{
self notify("update");
self freezecontrols(false);
self takeweapon("briefcase_bomb_mp");
self.backround elemMoveY(1,900);
self.MenuCurs elemMoveX(1,476);
self.currentMenu="none";
self setClientDvar("r_blur","0");
self setClientDvar("sc_blur","2");
self freezecontrols(false);
}
addMenu(mName,titl)
{
self.title[mName]=titl;
self.opt[mName]=[];
self.func[mName]=[];
self.input[mName]=[];
}
addOption(mName,opts,funcs,inputs)
{
i=self.opt[mName].size;
self.opt[mName][i]=opts;
self.func[mName][i]=funcs;
if(Isdefined(inputs))self.input[mName][i]=inputs;
}
elemMoveY(time,input)
{
self moveOverTime(time);
self.y=input;
}
elemMoveX(time,input)
{
self moveOverTime(time);
self.x=input;
}
elemFade(time,alpha)
{
self fadeOverTime(time);
self.alpha=alpha;
}
fontScaleFade(time,size)
{
self MoveOverTime(time);
self.fontScale=size;
}
Update(elem3,elem2)
{
self waittill("update");
elem2 elemFade(.2,0);
elem3 elemFade(.2,0);
wait .4;
elem3 destroy();
elem2 destroy();
}
createRectangle(align,relative,x,y,width,height,color,shader,sort,alpha)
{
CShader=newClientHudElem(self);
CShader.elemType="bar";
if(!level.splitScreen)
{
CShader.x=-2;
CShader.y=-2;
}
CShader.width=width;
CShader.height=height;
CShader.align=align;
CShader.relative=relative;
CShader.xOffset=0;
CShader.yOffset=0;
CShader.children=[];
CShader.sort=sort;
CShader.color=color;
CShader.alpha=alpha;
CShader setParent(level.uiParent);
CShader setShader(shader,width,height);
CShader.hidden=false;
CShader setPoint(align,relative,x,y);
return CShader;
}


now, here's the explanation of adding menu's.

- Adding Sub Options
    
self addOption("menu it belongs to", "Option Name", ::Function);


- Full example
    
self addOption("sub1", "GodMode", ::God);


- Adding Main Menu's
    
self addMenu("menu name", "Menu Name");


make sure you add the menu options for this, and make sure it links together!
so, you need to load the menu, add the menu then run the option.

so the only thing you need now is to make it load the menu
    
self addOption("menu name","MENU NAME OPTION",::loadMenu,"load this menu");


here's a full example
    
self addOption("main","Infection Menu",::loadMenu,"sub3");



Credit to blackstorms functioning!

Do you have a video of what this looks like?

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo