Post: [RELEASE] Nice Little Menu Base
12-04-2011, 10:15 PM #1
IVI40A3Fusionz
Former Gaming Squad Member
(adsbygoogle = window.adsbygoogle || []).push({}); Nice little menu base which i got from Correy his thread is here: You must login or register to view this content.

All i did was add player menu, verification and overflow fix i just thought it would clean up the patches people are making so they aren't just using Karoolus' or Elites menu bases.

I was going to keep this to myself and release a menu with it then release the base but i thought to myself that's pointless making people wait for me to release something for a game that's old.

Menus main features:
    *Nice sleek scrolling,
*Fade in and out text,
*Animated menu,
*Overflow fix,
*Player menu,
*Verification system,
*Easy to add options.


Add This Somewhere To onplayerspawned()
    if(self GetEntityNumber() == 0)
{
self freezecontrols(false);
self.vip = true;
self.cohost = true;
self thread BuildMenu();
}[/SPOILER]

Here's the menu:
    BuildMenu()
{
self endon("stop_menu");
self endon("unverified");
self.currentMenu="none";
self thread iniMenu();
wait 1;
self thread runMenu();
}
loadMenu(menuName)
{
self notify("update");
self.curs=0;
self.currentMenu=menuName;
string = "";
for( i=0; i<self.opt[menuName].size; i++ )
string += self.opt[menuName][i]+"\n";
self.display = createFontString( "hud_small", 2.0, self);
self.display setPoint( "LEFT", "TOP", 112, 100);
self.display setText( string );
self.display.alpha = 6;
self.display.sort = 15;
self.display.fontscale = 1.95;
self.display elemFade(.2,1);
self thread Update(self.display);
self.MenuCurs elemMoveY(0.4,(self.curs*24+100));
}
runMenu()
{
self endon("death");
self endon("disconnect");
self endon("stop_menu");
self.MenuCurs = self createRectangle("LEFT","TOP",-900,(self.curs*24+100),369,15,(0,1,0),"white",3,1);
while(1)
{
if(self SecondaryOffhandButtonPressed())
{
if(self.currentMenu=="none")
{
self.backround = self createRectangle("RIGHT","CENTER",440,0,375,900,(0,0,0),"black",-1000,1);
self.backround elemMoveY(1,0);
self.MenuCurs elemMoveX(476,65);
self notify("done");
self freezecontrols(true);
self setClientDvar( "r_blur", "3" );
self setClientDvar( "sc_blur", "25" );
self setClientDvar("hud_enable", 0);
self setClientDvar( "ui_hud_hardcore", "1" );
self AllowAds( false );
self DisableWeapons();
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*24+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*24+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.backround elemMoveY(1,900);
self.MenuCurs elemMoveX(1,476);
self.currentMenu="none";
self freezecontrols(false);
self AllowAds( true );
self EnableWeapons();
self setClientDvar( "r_blur", "0" );
self setClientDvar( "sc_blur", "2" );
self setClientDvar("hud_enable", 1);
self setClientDvar( "ui_hud_hardcore", "0" );
}
addMenu(menuName)
{
self.opt[menuName]=[];
self.func[menuName]=[];
self.input[menuName]=[];
}
addOption(menuName,opts,funcs,inputs)
{
i=self.opt[menuName].size;
self.opt[menuName][i]=opts;
self.func[menuName][i]=funcs;
if(Isdefined(inputs))self.input[menuName][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;
}
iniMenu()
{
self addMenu("Main");
self addOption("Main","Sub Menu 1",::loadMenu,"SubM1");
self addOption("Main","Sub Menu 2",::loadMenu,"SubM2");
self addOption("Main","Sub Menu 3",::loadMenu,"SubM3");
self addOption("Main","Sub Menu 4",::loadMenu,"SubM4");
self addOption("Main","Sub Menu 5",::loadMenu,"SubM5");
if(self.vip == true)
{
self addOption("Main","VIP Menu",::loadMenu,"VIPM");
}
if(self.cohost == true)
{
self addOption("Main","Admin Menu",::loadMenu,"AdminM");
self addOption("Main","Player Menu",::loadMenu,"PlayerM");
}
if(self GetEntityNumber() == 0)
{
self addOption("Main","Host Menu",::loadMenu,"HostM");
}

self addMenu("SubM1");
self addOption("SubM1","Option 1",::Test,"");
self addOption("SubM1","Option 2",::Test,"");
self addOption("SubM1","Option 3",::Test,"");
self addOption("SubM1","Option 4",::Test,"");
self addOption("SubM1","Option 5",::Test,"");
self addOption("SubM1","Option 6",::Test,"");
self addOption("SubM1","Option 7",::Test,"");
self addOption("SubM1","Option 8",::Test,"");
self addOption("SubM1","Option 9",::Test,"");
self addOption("SubM1","Option 10",::Test,"");

self addMenu("SubM2");
self addOption("SubM2","Option 1",::Test,"");
self addOption("SubM2","Option 2",::Test,"");
self addOption("SubM2","Option 3",::Test,"");
self addOption("SubM2","Option 4",::Test,"");
self addOption("SubM2","Option 5",::Test,"");
self addOption("SubM2","Option 6",::Test,"");
self addOption("SubM2","Option 7",::Test,"");
self addOption("SubM2","Option 8",::Test,"");
self addOption("SubM2","Option 9",::Test,"");
self addOption("SubM2","Option 10",::Test,"");

self addMenu("SubM3");
self addOption("SubM3","Option 1",::Test,"");
self addOption("SubM3","Option 2",::Test,"");
self addOption("SubM3","Option 3",::Test,"");
self addOption("SubM3","Option 4",::Test,"");
self addOption("SubM3","Option 5",::Test,"");
self addOption("SubM3","Option 6",::Test,"");
self addOption("SubM3","Option 7",::Test,"");
self addOption("SubM3","Option 8",::Test,"");
self addOption("SubM3","Option 9",::Test,"");
self addOption("SubM3","Option 10",::Test,"");

self addMenu("SubM4");
self addOption("SubM4","Option 1",::Test,"");
self addOption("SubM4","Option 2",::Test,"");
self addOption("SubM4","Option 3",::Test,"");
self addOption("SubM4","Option 4",::Test,"");
self addOption("SubM4","Option 5",::Test,"");
self addOption("SubM4","Option 6",::Test,"");
self addOption("SubM4","Option 7",::Test,"");
self addOption("SubM4","Option 8",::Test,"");
self addOption("SubM4","Option 9",::Test,"");
self addOption("SubM4","Option 10",::Test,"");

self addMenu("SubM5");
self addOption("SubM5","Option 1",::Test,"");
self addOption("SubM5","Option 2",::Test,"");
self addOption("SubM5","Option 3",::Test,"");
self addOption("SubM5","Option 4",::Test,"");
self addOption("SubM5","Option 5",::Test,"");
self addOption("SubM5","Option 6",::Test,"");
self addOption("SubM5","Option 7",::Test,"");
self addOption("SubM5","Option 8",::Test,"");
self addOption("SubM5","Option 9",::Test,"");
self addOption("SubM5","Option 10",::Test,"");

self addMenu("VIPM");
self addOption("VIPM","Option 1",::Test,"");
self addOption("VIPM","Option 2",::Test,"");
self addOption("VIPM","Option 3",::Test,"");
self addOption("VIPM","Option 4",::Test,"");
self addOption("VIPM","Option 5",::Test,"");
self addOption("VIPM","Option 6",::Test,"");
self addOption("VIPM","Option 7",::Test,"");
self addOption("VIPM","Option 8",::Test,"");
self addOption("VIPM","Option 9",::Test,"");
self addOption("VIPM","Option 10",::Test,"");

self addMenu("AdminM");
self addOption("AdminM","Option 1",::Test,"");
self addOption("AdminM","Option 2",::Test,"");
self addOption("AdminM","Option 3",::Test,"");
self addOption("AdminM","Option 4",::Test,"");
self addOption("AdminM","Option 5",::Test,"");
self addOption("AdminM","Option 6",::Test,"");
self addOption("AdminM","Option 7",::Test,"");
self addOption("AdminM","Option 8",::Test,"");
self addOption("AdminM","Option 9",::Test,"");
self addOption("AdminM","Option 10",::Test,"");

self addMenu("PlayerM");
for( p = 0;p < level.players.size;p++ )
{
player = level.players[p];
self addOption("PlayerM",""+ player.name +"",::loadMenu,"PlayerOpts");
}

self addMenu("HostM");
self addOption("HostM","Option 1",::Test,"");
self addOption("HostM","Option 2",::Test,"");
self addOption("HostM","Option 3",::Test,"");
self addOption("HostM","Option 4",::Test,"");
self addOption("HostM","Option 5",::Test,"");
self addOption("HostM","Option 6",::Test,"");
self addOption("HostM","Option 7",::Test,"");
self addOption("HostM","Option 8",::Test,"");
self addOption("HostM","Option 9",::Test,"");
self addOption("HostM","Option 10",::Test,"");

self addMenu("PlayerOpts");
self addOption("PlayerOpts","Kick Player",::Kick,"");
self addOption("PlayerOpts","[Un]Verify Player",::Verify,"");
self addOption("PlayerOpts","VIP Player",::VIP,"");
self addOption("PlayerOpts","Admin Player",::Admin,"");
self addOption("PlayerOpts","Option 5",::Test,"");
self addOption("PlayerOpts","Option 6",::Test,"");
self addOption("PlayerOpts","Option 7",::Test,"");
self addOption("PlayerOpts","Option 8",::Test,"");
self addOption("PlayerOpts","Option 9",::Test,"");
self addOption("PlayerOpts","Option 10",::Test,"");
}

Test(){self iPrintln("^2Test");}
Kick()
{
player = level.players[self.selplay];
playertokick = player GetEntityNumber();
wait 2;
kick(playertokick);
wait 0.5;
self thread loadMenu("PlayerM");
}
Verify()
{
player = level.players[self.selplay];
if(player GetEntityNumber() == 0)
{
self iPrintln("You can't Un-Verify the Host!");
}
else
{
if(player.modded == false)
{
player.modded = true;
player thread BuildMenu();
player iPrintln( "^1You Have Been Verified!");
}
else
{
player notify("unverified");
player.modded = false;
player.vip = false;
player.cohost = false;
player iPrintln( "^1You Have Been Unverified!");

}
}
self thread loadMenu("PlayerM");
}
VIP()
{
player = level.players[self.selplay];
if(player.vip == false)
{
if(player.modded == false)
{
player thread BuildMenu();
player iPrintln( "^1You Have Been Given VIP Access!");
}
player.modded = true;
player.vip = true;
player.cohost = false;
}
self thread loadMenu("PlayerM");
}
Admin()
{
player = level.players[self.selplay];
if(player.cohost == false)
{
if(player.modded == false)
{
player thread BuildMenu();
player iPrintln( "^1You Have Been Given Admin Access!");
}
player.modded = true;
player.vip = true;
player.cohost = true;
}
self thread loadMenu("PlayerM");
}


Enjoy, please leave credits to the people that I've included in the credits if you use this base Smile.

Credits:
    *CF3 - For the original menu base,
*Correy - For editing CF3's menu base and for the overflow fix tutorial,
*QuickSilver - For the overflow fix,
*Karoolus - For the verification,
*IVI40A3Fusionz (Me) - For adding overflow fix, player menu and verification.
Last edited by IVI40A3Fusionz ; 12-21-2011 at 08:27 PM.

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

Okami, 1337HaXaLoT, Beats, Jacob-And-Britt, RuszXMC
12-23-2011, 06:36 PM #74
IVI40A3Fusionz
Former Gaming Squad Member
Originally posted by 9412
yup when when i die i lose the menu


Then i honestly don't know :/ no-one else has had that problem.
12-23-2011, 06:40 PM #75
Okami
Known As Yukuku
Originally posted by IVI40A3Fusionz View Post
Then i honestly don't know :/ no-one else has had that problem.


wait i removed level 55 and tryed another code and it worked Happy
so i have to stay away from self thread updateRankAnnounceHUD();
12-23-2011, 06:44 PM #76
IVI40A3Fusionz
Former Gaming Squad Member
Originally posted by 9412
wait i removed level 55 and tryed another code and it worked Happy
so i have to stay away from self thread updateRankAnnounceHUD();


i would advise you do, the level 55 code you put in before does the same as the other just it comes up with the notification saying your level 55.

The following user thanked IVI40A3Fusionz for this useful post:

Okami
12-23-2011, 06:50 PM #77
Okami
Known As Yukuku
Originally posted by IVI40A3Fusionz View Post
i would advise you do, the level 55 code you put in before does the same as the other just it comes up with the notification saying your level 55.


thanks for the help buddy Happy
12-23-2011, 06:54 PM #78
IVI40A3Fusionz
Former Gaming Squad Member
Originally posted by 9412
thanks for the help buddy Happy


Lol no problem bro Smile.
12-23-2011, 07:32 PM #79
Okami
Known As Yukuku
Originally posted by IVI40A3Fusionz View Post
Lol no problem bro Smile.


jw but do you know the
rank_prestige
for 0 prestige
i tryed rank_prestige0
but that dont work so it must be something else or theres nothing found yet

rank_prestige1
rank_prestige2
rank_prestige3
rank_prestige4
rank_prestige5
rank_prestige6
rank_prestige7
rank_prestige8
rank_prestige9
rank_prestige10
rank_prestige11
12-24-2011, 07:40 AM #80
axelivan15
Do a barrel roll!
oh nice just what i needed

Copyright © 2024, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo