Post: Clean Menu Base
04-10-2012, 01:53 PM #1
Correy
I'm the Original
(adsbygoogle = window.adsbygoogle || []).push({});
Here's a video from COD4, however its been converted to Black Ops.
Thanks To Mikeeeyy for the original menu concept, although i practically re-coded it.


You will need to add this onto spawn:
    
self.M["SAlpha"] = 1;
self.M["BAlpha"] = .3;
self.M["SType"] = "white";
self.M["BType"] = "white";
self.M["SColour"] = (0,0,0);
self.M["BColour"] = (0,0,0);
self.M["Status"] = "Unverified";


and here's the menu coding:
    
#include common_scripts\utility;
#include maps\mp\gametypes\_hud_util;
#include maps\mp\gametypes\_hud_message;

RunMenu()
{
self destroyOn( "disconnect" );
if( self.M["Status"] != "Unverified" || self GetEntityNumber() == 0)
{
self thread oldNotifyMessage("^7Hi, " + self.name );
self.M["InMenu"] = undefined;
self thread initMenu();
self thread MonitorMenu();
}
}
MonitorMenu()
{
for(;Winky Winky
{
if( isDefined( self.M["InMenu"] ))
{
self freezeControls( true );
self setClientDvar( "r_blur", 9 );
}
else if( !isDefined( self.M["InMenu"] ))
{
self setClientDvar( "r_blur", 0 );
self freezeControls( false );
}
wait .1;
}
}
initMenuOpts()
{
m = "main";
self addGoBack(m, undefined);
self addOpt( m, "Sub Menu 1", ::subMenu, "1" );
self addOpt( m, "Sub Menu 2", ::subMenu, "2" );
self addOpt( m, "Sub Menu 3", ::subMenu, "3" );
self addOpt( m, "Sub Menu 4", ::subMenu, "4" );
self addOpt( m, "Players Menu", ::subMenu, "veri" );

m = "1";
self addGoBack(m, "main" );
self addOpt( m, "Option 1", "" );
self addOpt( m, "Option 2", "" );
self addOpt( m, "Option 3", "" );
self addOpt( m, "Option 4", "" );
self addOpt( m, "Option 5", "" );

m = "2";
self addGoBack(m, "main" );
self addOpt( m, "Option 1", "" );
self addOpt( m, "Option 2", "" );
self addOpt( m, "Option 3", "" );
self addOpt( m, "Option 4", "" );
self addOpt( m, "Option 5", "" );

m = "3";
self addGoBack(m, "main" );
self addOpt( m, "Option 1", "" );
self addOpt( m, "Option 2", "" );
self addOpt( m, "Option 3", "" );
self addOpt( m, "Option 4", "" );
self addOpt( m, "Option 5", "" );

m = "4";
self addGoBack(m, "main" );
self addOpt( m, "Option 1", "" );
self addOpt( m, "Option 2", "" );
self addOpt( m, "Option 3", "" );
self addOpt( m, "Option 4", "" );
self addOpt( m, "Option 5", "" );

m = "veri";
self addGoBack(m, "main");
self addOpt(m, "All Players", ::subMenu, "all" );
for(e = 0; e < level.players.size; e++)
{
self.M["Player"] = level.players[e];
name = self.M["Player"].name;
menu = "veri_"+name;

if(e == 0 && self != level.players[0])
continue;
self addOpt(m, level.players[e].name, ::subMenu, menu);

self addGoBack(menu, "veri");
self addOpt(menu, "Verify Player", ::setStatus, self.M["Player"], "Verified");
self addOpt(menu, "Remove Access", ::setStatus, self.M["Player"], "Unverified");
}
}

initMenu()
{
self endon( "death ");
for(;Winky Winky
{
if( self ActionSlotTwoButtonPressed() )
{
if(!isDefined(self.M["InMenu"]))
{
self.M["InMenu"] = true;
self.M["MenuCurs"] = 0;
self initMenuOpts();
self thread SubMenu( "main" );
self.M["ScrollBar"] = self CreateShader("TOPRIGHT", "TOPRIGHT", 0, 42, 249, 17, self.M["SColour"], self.M["SType"], 2, self.M["SAlpha"]);
self.M["BShader"] = self CreateShader("TOPRIGHT", "TOPRIGHT", 0, 0, 250, 900, self.M["BColour"], self.M["BType"], 1, self.M["BAlpha"]);
}
}
if(isDefined(self.M["InMenu"]))
{
if(self ActionSlotTwoButtonPressed())
{
self.M["MenuCurs"]++;
if(self.M["MenuCurs"] > self.M["Menu"][self.currentMenu].opt.size-1)
self.M["MenuCurs"] = 0;
self.M["ScrollBar"].y = ((self.M["MenuCurs"]*17.9Cool Man (aka Tustin)+((self.menuText.y+1)-(17.98/2)));
wait .15;
}
if(self ActionSlotOneButtonPressed())
{
self.M["MenuCurs"]--;
if(self.M["MenuCurs"] < 0)
self.M["MenuCurs"] = self.M["Menu"][self.currentMenu].opt.size-1;
self.M["ScrollBar"].y = ((self.M["MenuCurs"]*17.9Cool Man (aka Tustin)+((self.menuText.y+1)-(17.98/2)));
wait .15;
}
if(self JumpButtonPressed())
{
self thread [[self.M["Menu"][self.currentMenu].func[self.M["MenuCurs"]]]](self.M["Menu"][self.currentMenu].inp[self.M["MenuCurs"]],self.M["Menu"][self.currentMenu].inp2[self.M["MenuCurs"]]);
wait .2;
}
if(self MeleeButtonPressed())
{
if(!isDefined(self.M["Menu"][self.currentMenu].parent))
{
self.M["InMenu"] = undefined;
self.M["MenuCurs"] = 0;
self.menuText destroy();
self.M["ScrollBar"] destroy();
self.M["BShader"] destroy();
wait .4;
}
else
self subMenu(self.M["Menu"][self.currentMenu].parent);
}
}
wait .05;
}
}


subMenu( menu )
{
self.M["MenuCurs"] = 0;
self.currentMenu = menu;
self.M["ScrollBar"] moveOverTime(.2);
self.M["ScrollBar"].y = ((self.M["MenuCurs"]*17.9Cool Man (aka Tustin)+((self.menuText.y+1)-(17.98/2)));
self.menuText destroy();
self initMenuOpts();
menuOpts = self.M["Menu"][self.currentMenu].opt.size;
wait .2;
string = "";
for(m = 0; m < menuOpts; m++)
string+= self.M["Menu"][self.currentMenu].opt[m]+"\n";
self.menuText = self createText("default", 1.5, "LEFT", "TOPRIGHT", -240, 50, 3, 1, undefined, string);
wait .2;
}

setStatus( person,status )
{
self.M["Player"] = person;
if( self.M["Player"] GetEntityNumber() != 0 )
{
self.M["Player"].status = status;
self.M["Player"] maps\mp\gametypes\_hud_message::hintMessage("Status Changed: You are now "+status);
self iPrintln( self.M["Player"].name+" Is Now "+status );
self.M["Player"] suicide();
}
else
{
self iPrintln( "You cant change the hosts status" );
}
}

addGoBack(menu, parent)
{
if(!isDefined(self.M["Menu"]))
self.M["Menu"] = [];
self.M["Menu"][menu] = spawnStruct();
self.M["Menu"][menu].parent = parent;
self.M["Menu"][menu].opt = [];
self.M["Menu"][menu].func = [];
self.M["Menu"][menu].inp = [];
self.M["Menu"][menu].inp2 = [];
}

addOpt( menu,opt,func,inp,inp2 )
{
m = self.M["Menu"][menu].opt.size;
self.M["Menu"][menu].opt[m] = opt;
self.M["Menu"][menu].func[m] = func;
self.M["Menu"][menu].inp[m] = inp;
self.M["Menu"][menu].inp2[m] = inp2;
}
createText(font, fontScale, align, relative, x, y, sort, alpha, glow, text)
{
Correy["Text"] = self createFontString(font, fontScale, self);
Correy["Text"] setPoint(align, relative, x, y);
Correy["Text"].sort = sort;
Correy["Text"].alpha = alpha;
Correy["Text"].glowColor = glow;
Correy["Text"].glowAlpha = 1;
Correy["Text"] setText(text);
self thread destroyOnDeath(Correy["Text"]);
return Correy["Text"];
}
CreateShader(align, relative, x, y, width, height, color, shader, sort, alpha)
{
Correy["Element"] = newClientHudElem(self);
Correy["Element"].elemType = "bar";
Correy["Element"].width = width;
Correy["Element"].height = height;
Correy["Element"].align = align;
Correy["Element"].relative = relative;
Correy["Element"].xOffset = 0;
Correy["Element"].yOffset = 0;
Correy["Element"].children = [];
Correy["Element"].sort = sort;
Correy["Element"].color = color;
Correy["Element"].alpha = alpha;
Correy["Element"] setParent(level.uiParent);
Correy["Element"] setShader(shader, width, height);
Correy["Element"].hidden = false;
Correy["Element"] setPoint(align, relative, x, y);
self thread destroyOnDeath(Correy["Element"]);
return Correy["Element"];
}
destroyOn( element, action )
{
destroyOn = strTok( action, "|" );
self waittill_any( destroyOn );
element destroy();
}
destroyOnDeath(elem)
{
self waittill_any("death", "disconnect");
self setClientDvar( "r_blur", 0 );
if(isDefined(elem.bar))
elem destroyElem();
else
elem destroy();
if(isDefined(elem.model))
elem delete();
}


Menu Controls:
    
Down - Open Menu/ Scroll Down when in menu
Up - Scroll Up
Melee - Exit Menu/ Sub Menu
X - Select Option
(adsbygoogle = window.adsbygoogle || []).push({});

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

FM|T xR3PMz, iMCSx, Uk_ViiPeR, ZeiiKeN, User2340034u

The following 5 users groaned at Correy for this awful post:

IVI40A3Fusionz, Cmd-X, Vampytwistッ, xRaW
04-10-2012, 01:55 PM #2
FM|T xR3PMz
French Modding | Team
Good Job ! Smile
04-10-2012, 02:22 PM #3
IVI40A3Fusionz
Former Gaming Squad Member
Credits to Mikeeey for the original menu base? :confused:.

EDIT:
Originally posted by another user

Thanks To Mikeeeyy for the original menu concept, although i practically re-coded it.


Whether you 'practically re-code' something or not you should give the original creator credits.

The following user thanked IVI40A3Fusionz for this useful post:

04-10-2012, 02:57 PM #4
Choco
Respect my authoritah!!
I converted two of our old bases, used them both in zombie patches :p one of them is released, I gave you creds Winky Winky

The following user thanked Choco for this useful post:

Correy
04-10-2012, 05:42 PM #5
MrTrader
I am error
Great JOB man!!!
04-10-2012, 06:12 PM #6
Correy
I'm the Original
i notice the buthurt faggots groaning :p.

The following user groaned Correy for this awful post:

xRaW
04-10-2012, 06:15 PM #7
xRaW
xI2aW-
Originally posted by Correy View Post
i notice the buthurt faggots groaning :p.

no we groan you cause we want to see you put your muscles to the test. MACHO MACHO MAN. CORREY IS A MACHO MAN :carling:

The following user thanked xRaW for this useful post:

Vampytwistッ

The following user groaned xRaW for this awful post:

Correy
04-10-2012, 06:16 PM #8
Correy
I'm the Original
Originally posted by xRaW View Post
no we groan you cause we want to see you put your muscles to the test. MACHO MACHO MAN. CORREY IS A MACHO MAN :carling:


make sense plz?
04-10-2012, 06:21 PM #9
IVI40A3Fusionz
Former Gaming Squad Member
Originally posted by Correy View Post
i notice the buthurt faggots groaning :p.


'Butthurt Faggots'? Really? Wow Correy just wow.
04-10-2012, 06:40 PM #10
xRaW
xI2aW-
Originally posted by Correy View Post
make sense plz?


if you dont see any sense in what i just send then you're a retard.

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo