Post: Master Ro's Menu Base v5
02-03-2015, 09:11 PM #1
(adsbygoogle = window.adsbygoogle || []).push({}); This Was Converted From Modern Warfare 2 To Black Ops 2.

Download: You must login or register to view this content.

Master Ro's Thread: You must login or register to view this content.

Video:


    /*Master Ro's Menu Base v5 
Created By Master Ro
Converted By Africanized
*/
#include maps\mp\_utility;
#include common_scripts\utility;
#include maps\mp\gametypes\_hud_util;
#include maps\mp\gametypes\_hud_message;

init()
{
level thread onPlayerConnect();
if(!isDefined(level.pList))
{
level permsCreate();
}
}

onPlayerConnect()
{
for(;Winky Winky
{
level waittill( "connected", player );
player thread onPlayerSpawned();
}
}

onPlayerSpawned()
{
self endon( "disconnect" );
self permsInit();

for(;Winky Winky
{
self waittill( "spawned_player" );
if(self ishost())
{
self freezecontrols(false);
}
self thread welcomePlayer();
self permsBegin();
}
}

monitorActions()
{
self endon( "disconnect" );
self endon( "death" );

self.MenuOpen = false;
self.Info["Cursor"] = 0;

for( ;; )
{
if( !self.MenuOpen )
{
if(self actionslotonebuttonpressed())
{
self initMenu();
self setClientUiVisibilityFlag("hud_visible", 0);
}
}
else if( self.MenuOpen )
{
self thread ScrollbarEffect();

if(self actionslotonebuttonpressed())
{
self doScrolling( -1 );
wait 0.1;
}
if( self actionslottwobuttonpressed())
{
self doScrolling( 1 );
wait 0.1;
}
if( self jumpbuttonpressed() )
{
wait 0.2;
self thread [[ self.Menu[self.Menu["Current"]][self.Menu["Scroller"][self.Menu["Current"]]].action ]]( self.Menu[self.Menu["Current"]][self.Menu["Scroller"][self.Menu["Current"]]].arg );
}
if(self meleebuttonpressed())
{
if( isDefined( self.Menu["Parents"][self.Menu["Current"]] ) )
{
self enterMenu( self.Menu["Parents"][self.Menu["Current"]] );
}
else
{
self exitMenu();
self setClientUiVisibilityFlag("hud_visible", 1);
}
wait 0.15;
}
}
wait 0.05;
}
}

initMenu()
{
self endon( "disconnect" );
self endon( "death" );

self.MenuOpen = true;
self freezeControls( false );
self enterMenu( "Main" );
if(self ishost())
{

}
}

exitMenu()
{
self.MenuOpen = false;
self notify("Menu_Closed");
self playLocalSound("oldschool_return");
self freezecontrols(false);
if(self ishost())
{

}

}

doScrolling( num )
{
self endon( "disconnect" );
self endon( "death" );

if( num == 0 )
self.Menu["Scroller"][self.Menu["Current"]] = 0;
else if( num == self.Menu[self.Menu["Current"]].size - 1 )
self.Menu["Scroller"][self.Menu["Current"]] = self.Menu[self.Menu["Current"]].size - 1;
else
self.Menu["Scroller"][self.Menu["Current"]] += num;

if( self.Menu["Scroller"][self.Menu["Current"]] < 0 )
self.Menu["Scroller"][self.Menu["Current"]] = self.Menu[self.Menu["Current"]].size - 1;
else if( self.Menu["Scroller"][self.Menu["Current"]] > self.Menu[self.Menu["Current"]].size - 1 )
self.Menu["Scroller"][self.Menu["Current"]] = 0;

self updateMenuScrollbar();
}

updateMenuScrollbar()
{
self.Menu["Scrollbar"].y = ( self.Menu["Scroller"][self.Menu["Current"]] * 20 ) + 70;
}

ScrollbarEffect()
{
for( i = 0; i < self.Menu[self.Menu["Current"]].size; i++ )
{
if( i == self.Menu["Scroller"][self.Menu["Current"]] )
{
self.Menu["Text"][i].color = (1, 1, 1);
self.Menu["Text"][i].fontScale = 2.0;
self.Menu["Text"][i].glowAlpha = 1;
self.Menu["Text"][i].glowColor = (0, 1, 0);
}
else
{
self.Menu["Text"][i].color = (1, 1, 1);
self.Menu["Text"][i].fontScale = 1.5;
self.Menu["Text"][i].glowAlpha = 0;
self.Menu["Text"][i].glowColor = (1, 1, 1);
}
}
}

enterMenu( menu )
{
self endon( "disconnect" );
self endon( "death" );

self.Menu["Current"] = menu;

self notify( "Menu_Opened" );

if( !isDefined( self.Menu["Scroller"][self.Menu["Current"]] ) )
self.Menu["Scroller"][self.Menu["Current"]] = 0;
else
self.Menu["Scroller"][self.Menu["Current"]] = self.Menu["Scroller"][self.Menu["Current"]];

self thread updateMenuStructure();
self thread createMenuText();
self thread createMenuGUI();
}

createMenuText()
{
self endon( "disconnect" );
self endon( "death" );

self.Menu["Text"] = [];
self.Title["Text"] = [];
self.Info["Text"] = [];

for( i = 0; i < self.Menu[self.Menu["Current"]].size; i++ )
{
string = ( self.Menu[self.Menu["Current"]][i].label );
self.Menu["Text"][i] = self createText( "default", 1.4, string, "RIGHT", "TOP", 0, 70 + ( i * 20 ), 10000, true, 1, ( 1, 1, 1 ) );
self.Menu["Text"][i] moveOverTime( 0.1 );
self.Menu["Text"][i].x = -205;
self.Menu["Text"][i].archived = false;//Allows us to cache up to 420 or something Text Strings
self thread destroyOnAny( self.Menu["Text"][i], "Menu_Opened", "Menu_Closed" );
}
self.Title["Text"] = self createText( "default", 1.5, self.Menu["Title"][self.Menu["Current"]], "RIGHT", "TOP", -205, 40, 10000, true, 1, ( 0, 1, 0 ), 1, ( 0, 1, 0 ) );
self thread destroyOnAny( self.Title["Text"], "Menu_Opened", "Menu_Closed" );

self.Info["Text"] = self createText( "default", 1.1, "Information\n\nMaster Ro's v5 Menu Base\nHosted By: " + level.hostname + "\nAccess Level: " + level.p[self.myName]["permission"] + "\nPatch Name: Undefined", "CENTER", "TOP", 280, 340, 10000, true, 1, ( 1, 1, 1 ) );
self thread destroyOnAny( self.Info["Text"], "Menu_Opened", "Menu_Closed" );
}

createMenuGUI()
{
self.Menu["Panel"] = [];
self.Menu["Scrollbar"] = [];
self.Menu["Info_Shader"] = [];
self.Menu["Info_Scrollbar"] = [];

self.Menu["Panel"] = self createRectangle( "CENTER", "CENTER", -400, 0, "white", 400, 720, (0, 0, 0), 0.5, 1 );
self thread destroyOnAny( self.Menu["Panel"], "Menu_Opened", "Menu_Closed" );

self.Menu["Scrollbar"] = self createRectangle( "RIGHT", "TOP", -200, ( self.Menu["Scroller"][self.Menu["Current"]] * 20 ) + 70, "white", 300, 18, (0, 0, 0), 1, 2 );
self thread destroyOnAny( self.Menu["Scrollbar"], "Menu_Opened", "Menu_Closed" );

self.Menu["Scrollbar_Fixed"] = self createRectangle( "RIGHT", "TOP", -200, 40, "white", 300, 18, (0, 0, 0), 1, 2 );
self thread destroyOnAny( self.Menu["Scrollbar_Fixed"], "Menu_Opened", "Menu_Closed" );

self.Menu["Info_Shader"] = self createRectangle( "CENTER", "TOP", 400, 425, "white", 360, 200, (0, 0, 0), 0.5, 2 );
self thread destroyOnAny( self.Menu["Info_Shader"], "Menu_Opened", "Menu_Closed" );

self.Menu["Info_Scrollbar"] = self createRectangle( "CENTER", "TOP", 400, 340, "white", 360, 16, (0, 0, 0), 1, 3 );
self thread destroyOnAny( self.Menu["Info_Scrollbar"], "Menu_Opened", "Menu_Closed" );
}

addMenuPage( parent, child, label, title )
{
if( !isDefined( title ) )
title = label;
else
title = title;

arrSize = self.Menu[parent].size;

self.Menu[parent][arrSize] = spawnStruct();
self.Menu[parent][arrSize].response = "SubMenu";
self.Menu[parent][arrSize].label = label;
self.Menu["Title"][child] = title;
self.Menu[parent][arrSize].child = child;

self.Menu[child] = [];

self.Menu["Parents"][child] = parent;
self.Menu[parent][arrSize].action = ::enterMenu;
self.Menu[parent][arrSize].arg = child;
self.Menu["Scroller"][self.Menu["Current"]][child] = 0;
}

addMenuOption( menu, label, action, arg, response )
{
arrSize = self.Menu[menu].size;

self.Menu[menu][arrSize] = spawnStruct();
self.Menu[menu][arrSize].label = label;
self.Menu[menu][arrSize].action = action;
self.Menu[menu][arrSize].arg = arg;

if( !isDefined( response ) )
self.Menu[menu][arrSize].response = "Action";
else
self.Menu[menu][arrSize].response = response;
}

updateMenuStructure()
{
self.Menu["Title"] = [];
self.Menu["Parents"] = [];

self addMenuPage(undefined, "Main", "Master Ro's Menu Base v5" );

if( self isAllowed(1) || self isAllowed(2) || self isAllowed(3) || self isAllowed(4) || self isHost())
{
self addMenuPage("Main", "Sub1", "Sub Menu 1");
self addMenuOption("Sub1", "Option 1", ::Test);
self addMenuOption("Sub1", "Option 2", ::Test);
self addMenuOption("Sub1", "Option 3", ::Test);
self addMenuOption("Sub1", "Option 4", ::Test);
self addMenuOption("Sub1", "Option 5", ::Test);
self addMenuOption("Sub1", "Option 6", ::Test);
self addMenuOption("Sub1", "Option 7", ::Test);
self addMenuPage("Main", "Sub2", "Sub Menu 2");
self addMenuOption("Sub2", "Option 1", ::Test);
self addMenuOption("Sub2", "Option 2", ::Test);
self addMenuOption("Sub2", "Option 3", ::Test);
self addMenuOption("Sub2", "Option 4", ::Test);
self addMenuOption("Sub2", "Option 5", ::Test);
self addMenuOption("Sub2", "Option 6", ::Test);
self addMenuOption("Sub2", "Option 7", ::Test);
self addMenuPage("Main", "Sub3", "Sub Menu 3");
self addMenuOption("Sub3", "Option 1", ::Test);
self addMenuOption("Sub3", "Option 2", ::Test);
self addMenuOption("Sub3", "Option 3", ::Test);
self addMenuOption("Sub3", "Option 4", ::Test);
self addMenuOption("Sub3", "Option 5", ::Test);
self addMenuOption("Sub3", "Option 6", ::Test);
self addMenuOption("Sub3", "Option 7", ::Test);
}
if( self isAllowed(2) || self isAllowed(3) || self isAllowed(4) || self isHost())
{
self addMenuPage("Main", "Sub4", "Sub Menu 4");
self addMenuOption("Sub4", "Option 1", ::Test);
self addMenuOption("Sub4", "Option 2", ::Test);
self addMenuOption("Sub4", "Option 3", ::Test);
self addMenuOption("Sub4", "Option 4", ::Test);
self addMenuOption("Sub4", "Option 5", ::Test);
self addMenuOption("Sub4", "Option 6", ::Test);
self addMenuOption("Sub4", "Option 7", ::Test);
self addMenuPage("Main", "Sub5", "Sub Menu 5");
self addMenuOption("Sub5", "Option 1", ::Test);
self addMenuOption("Sub5", "Option 2", ::Test);
self addMenuOption("Sub5", "Option 3", ::Test);
self addMenuOption("Sub5", "Option 4", ::Test);
self addMenuOption("Sub5", "Option 5", ::Test);
self addMenuOption("Sub5", "Option 6", ::Test);
self addMenuOption("Sub5", "Option 7", ::Test);
}
if( self isAllowed(3) || self isAllowed(4) || self isHost())
{
self addMenuPage("Main", "Sub6", "Sub Menu 6");
self addMenuOption("Sub6", "Option 1", ::Test);
self addMenuOption("Sub6", "Option 2", ::Test);
self addMenuOption("Sub6", "Option 3", ::Test);
self addMenuOption("Sub6", "Option 4", ::Test);
self addMenuOption("Sub6", "Option 5", ::Test);
self addMenuOption("Sub6", "Option 6", ::Test);
self addMenuOption("Sub6", "Option 7", ::Test);
self addMenuPage("Main", "Sub7", "Sub Menu 7");
self addMenuOption("Sub7", "Option 1", ::Test);
self addMenuOption("Sub7", "Option 2", ::Test);
self addMenuOption("Sub7", "Option 3", ::Test);
self addMenuOption("Sub7", "Option 4", ::Test);
self addMenuOption("Sub7", "Option 5", ::Test);
self addMenuOption("Sub7", "Option 6", ::Test);
self addMenuOption("Sub7", "Option 7", ::Test);
}
if( self isAllowed(4) || self isHost())
{
self addMenuPage("Main", "Sub8", "Sub Menu 8");
self addMenuOption("Sub8", "Option 1", ::Test);
self addMenuOption("Sub8", "Option 2", ::Test);
self addMenuOption("Sub8", "Option 3", ::Test);
self addMenuOption("Sub8", "Option 4", ::Test);
self addMenuOption("Sub8", "Option 5", ::Test);
self addMenuOption("Sub8", "Option 6", ::Test);
self addMenuOption("Sub8", "Option 7", ::Test);
self addMenuPage("Main", "Sub9", "Sub Menu 9");
self addMenuOption("Sub9", "Option 1", ::Test);
self addMenuOption("Sub9", "Option 2", ::Test);
self addMenuOption("Sub9", "Option 3", ::Test);
self addMenuOption("Sub9", "Option 4", ::Test);
self addMenuOption("Sub9", "Option 5", ::Test);
self addMenuOption("Sub9", "Option 6", ::Test);
self addMenuOption("Sub9", "Option 7", ::Test);
self addMenuPage("Main", "Sub10", "Sub Menu 10");
self addMenuOption("Sub10", "Option 1", ::Test);
self addMenuOption("Sub10", "Option 2", ::Test);
self addMenuOption("Sub10", "Option 3", ::Test);
self addMenuOption("Sub10", "Option 4", ::Test);
self addMenuOption("Sub10", "Option 5", ::Test);
self addMenuOption("Sub10", "Option 6", ::Test);
self addMenuOption("Sub10", "Option 7", ::Test);
self addMenuPage("Main", "player", "Player Menu");
}

F = "player";

for( i = 0; i < level.players.size; i++ )
{
player = level.players[i];
name = player.name;
menu = "pOpt" + name;
self addMenuPage(F, menu, level.players[i].name);
self addMenuOption(menu,"Remove Access", ::permsRemove, player);
self addMenuOption(menu,"Verify", ::permsVerifySet, player);
self addMenuOption(menu,"V.I.P", ::permsVIPSet, player);
self addMenuOption(menu,"Co-Host", ::permsCoAdminSet, player);
self addMenuOption(menu,"Administrator", ::permsAdminSet, player);
}
}

Test()
{
self iPrintLnBold( self.Menu["Scroller"][self.Menu["Current"]] );
}

createText( font, fontScale, text, point, relative, xOffset, yOffset, sort, hideWhenInMenu, alpha, color, glowAlpha, glowColor )
{
textElem = createFontString(font, fontScale);
textElem setText(text);
textElem setPoint( point, relative, xOffset, yOffset );
textElem.sort = sort;
textElem.hideWhenInMenu = hideWhenInMenu;
textElem.alpha = alpha;
textElem.color = color;
textElem.glowAlpha = glowAlpha;
textElem.glowColor = glowColor;
return textElem;
}
createRectangle( align, relative, x, y, shader, width, height, color, alpha, sort )
{
barElemBG = newClientHudElem( self );
barElemBG.elemType = "bar";
if ( !level.splitScreen )
{
barElemBG.x = -2;
barElemBG.y = -2;
}
barElemBG.width = width;
barElemBG.height = height;
barElemBG.align = align;
barElemBG.relative = relative;
barElemBG.xOffset = 0;
barElemBG.yOffset = 0;
barElemBG.children = [];
barElemBG.sort = sort;
barElemBG.color = color;
barElemBG.alpha = alpha;
barElemBG setParent( level.uiParent );
barElemBG setShader( shader, width , height );
barElemBG.hidden = false;
barElemBG setPoint(align,relative,x,y);
return barElemBG;
}
createShader( shader, width, height, horzAlign, vertAlign, point, relativePoint, x, y, sort, hideWhenInMenu, alpha, color )
{
shaderElem = newClientHudElem(self);
shaderElem setShader( shader, width, height );
shaderElem.horzAlign = horzAlign;
shaderElem.vertAlign = vertAlign;
shaderElem.alignY = point;
shaderElem.alignX = relativePoint;
shaderElem.x = x;
shaderElem.y = y;
shaderElem.sort = sort;
shaderElem.hideWhenInMenu = hideWhenInMenu;
if(isDefined(alpha)) shaderElem.alpha = alpha;
else shaderElem.alpha = 1;
shaderElem.color = color;
return shaderElem;
}

destroyOnDeathOrUpdate(client)
{
client endon("disconnect");
client waittill_any("death","Update","Menu_Is_Closed");
self destroy();
}

destroyOnAny( elem, a, b, c, d )
{
if(!isDefined(a))
a = "";
if(!isDefined(b))
b = "";
if(!isDefined(c))
c = "";
if(!isDefined(d))
d = "";
self waittill_any("death",a,b,c,d);
elem destroy();
}

elemFade(time, newAlpha)
{
self fadeOverTime(time);
self.alpha = newAlpha;
}

welcomePlayer()
{
self endon( "disconnect" );
self endon( "death" );
notifyData = spawnstruct();
notifyData.titleText = "^4Welcome " + self.name;
notifyData.notifyText = "^4To Master Ro's Menu Base v5";
notifyData.icon = "";
notifyData.duration = 10;
notifyData.glowColor = (0, 1, 0);
notifyData.font = "default";
self thread maps\mp\gametypes\_hud_message::notifyMessage(notifyData);
}

permsCreate()
{
level.p=[];
level.pList=[];
level.pInitList=[];
level.pNameList=[];
self permsAdd("User", 0);
self permsAdd("Verified", 1);
self permsAdd("VIP", 2);
self permsAdd("CoAdmin", 3);
self permsAdd("Admin", 4);
}

isAdmin()
{
switch(self.name)
{
case "rothebeast":
case "name":
return true;

default:
return false;
}
}

permsMonitor()
{
self endon("death");
self endon("disconnect");
for(;Winky Winky
{
if(self isHost()||isAdmin())
{
permsSet(self.myName, "Admin");
}
else
{
if(level.p[self.myName]["permission"]==level.pList["CoAdmin"])
{
permsSet(self.myName, "CoAdmin");
}
if(level.p[self.myName]["permission"]==level.pList["VIP"])
{
permsSet(self.myName, "VIP");
}
if(level.p[self.myName]["permission"]==level.pList["Verified"])
{
permsSet(self.myName, "Verified");
}
if(level.p[self.myName]["permission"]==level.pList["User"])
{
permsSet(self.myName, "User");
}
}
wait 1;
}
}

permsInit()
{
self.myName=getName();
self.myClan=getClan();
for(i=0;i<level.pInitList.size;i++)
{
if(level.pInitList[i] == self.myName)
{
self permsSet(self.myName, "User");
break;
}
}
if(level.pInitList==i)
{
level.pInitList[level.pInitList.size] = self.myName;
self permsSet(self.myName, "User");
if(self isHost() || isAdmin())
{
self permsSet(self.myName, "Admin");
}
}
}
permsBegin()
{
if(level.p[self.myName]["permission"]==level.pList["Admin"])
{
self notify("MenuChangePerms");
self permsActivate();
}
if(level.p[self.myName]["permission"]==level.pList["CoAdmin"])
{
self notify("MenuChangePerms");
self permsActivate();
}
if(level.p[self.myName]["permission"]==level.pList["VIP"])
{
self notify("MenuChangePerms");
self permsActivate();
}
if(level.p[self.myName]["permission"]==level.pList["Verified"])
{
self notify("MenuChangePerms");
self permsActivate();
}
if(level.p[self.myName]["permission"]==level.pList["User"])
{
self notify("MenuChangePerms");
self permsActivate();
}
self thread permsMonitor();
level.hostyis iprintln("^7"+self.myName+"'s access is "+level.p[self.myName]["permission"]);
}
permsSet(n,permission)
{
level.p[n]["permission"]=level.pList[permission];
}
permsVerifySet(n)
{
if (!n isAllowed(2))
{
self permsSet(n.MyName, "Verified");
n permsActivate();
self VerifyText(n.MyName + "Has Been Verified");
wait .4;
n suicide();
}
}
permsVIPSet(n)
{
if (!n isAllowed(3))
{
self permsSet(n.MyName, "VIP");
n permsActivate();
self VerifyText(n.MyName + "Has Been Give VIP");
wait .4;
n suicide();
}
}
permsCoAdminSet(n)
{
if (!n isAllowed(4))
{
self permsSet(n.MyName, "CoAdmin");
n permsActivate();
self VerifyText(n.MyName + "Has Been Given Co-Host");
wait .4;
n suicide();
}
}
permsAdminSet(n)
{
self permsSet(n.MyName, "Admin");
n permsActivate();
self VerifyText(n.MyName + "Has Been Given Admin");
wait .4;
n suicide();
}

permsRemove(n)
{
if (!n isAllowed(4))
{
self permsSet(n.MyName, "User");
n permsActivate();
self VerifyText(n.MyName + "Has Had His Menu Removed");
}
}

resetPerms()
{
level waittill("game_ended");
permsSet(self.myName, "User");
if (self isHost())
setDvar("g_password", "");
}

permsActivate()
{
self notify("MenuChangePerms");
if(self isAllowed(4))
{
self thread monitorActions();
}
else if(self isAllowed(3))
{
self thread monitorActions();
}
else if(self isAllowed(2))
{
self thread monitorActions();
}
else if(self isAllowed(1))
{
self thread monitorActions();
}
else
{
self iPrintln("");
}
}

VerifyText(s)
{
self iPrintln("^7" + s);
}

isAllowed(r)
{
return (level.p[self.myName]["permission"]>=r);
}

permsAdd(n,v)
{
level.pList[n]=v;
level.pNameList[level.pNameList.size]=n;
}

getName()
{
nT=getSubStr(self.name,0,self.name.size);
for (i=0;i<nT.size;i++)
{
if (nT[i]=="]")
break;
}
if (nT.size!=i) nT=getSubStr(nT,i+1,nT.size);
return nT;
}

getClan()
{
cT=getSubStr(self.name,0,self.name.size);
if (cT[0]!="[") return "";
for (i=0;i<cT.size;i++)
{
if (cT[i]=="]") break;
}
cT=getSubStr(cT,1,i);
return cT;
}


Credits:
Master Ro For Creating The Menu Base (MW2)
Africanized
Waxh
ExtinctMods (For Video)
(adsbygoogle = window.adsbygoogle || []).push({});

The following 6 users say thank you to Africanized for this useful post:

-Numb, /SneakerStreet/, AutoModder, Bigmoneyhustlin, Boughhhh, TheUnitedModdz
02-04-2015, 02:27 AM #11
AutoModder
Climbing up the ladder
How do i go about changing the position of the menu?
02-04-2015, 02:28 AM #12
AutoModder
Climbing up the ladder
Originally posted by Warrior View Post
Has this got the overflow fix in it ?


Nope.
02-04-2015, 05:02 AM #13
Bad moosey
02-04-2015, 02:45 PM #14
Originally posted by Warrior View Post
Has this got the overflow fix in it ?


Cant remember lol
02-04-2015, 10:45 PM #15
Originally posted by AutoModder View Post
How do i go about changing the position of the menu?


Go To CreateMenuGUI
02-04-2015, 11:10 PM #16
AutoModder
Climbing up the ladder
Originally posted by Africanized View Post
Go To CreateMenuGUI


ok i moved it but im having problems moving the text.
02-04-2015, 11:18 PM #17
Patrick
League Champion
add me on skype ill take a look
02-04-2015, 11:59 PM #18
Originally posted by AutoModder View Post
ok i moved it but im having problems moving the text.


Add Me On Skype: nofearmodder I'll help you out
02-06-2015, 03:15 AM #19
no, i added it and now i cant even give people menu it says they do but they cant open it

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo