Post: [RELEASE] Mashed-Up Menu Base
10-21-2014, 10:47 PM #1
(adsbygoogle = window.adsbygoogle || []).push({}); Okay so today I'm going to release so far what I have on this menu base, It's pretty good so far, except some bugs in the player menu which I will work on later tonight. This isn't the best menu base because of the following reasons

FEATURES:
    
- Nice GUI (imo)
- Coding is similar to IELITEMODZ Menu base
- Oldschool MW2 Menu 'feel'
- Basic Verification
- Fast Scrolling
- Features a coding mixture both from IELITEMODZ and xYARDSALEx


Features Going To Be Added In Later Updates:
    
- Overflow Fix (This menu doesn't use \n fix or a function to count numbers of setText)
- Fix Players Menu
- Fix the sloppy coding with better coding
- More


The reason this menu base is named 'Mashed-Up' is because I have taken to 'menus': IELITEMODZ COD4 Menu base and You must login or register to view this content. And I've sort of 'mashed' together to make this menu base.

The reason I've done this is I liked IELITEMODZ's simple coding and scripts, his menu base is very simple to understand, and I loved the look of this quick menu by Taylor but there was two problems

1.) I couldn't have the look of the quick menu with IELITEMODZ's menu base (It uses \n)
2.) Taylors Quick Menu Needed a better 'Base' that supported submenus and such.

And ta-daaaa here it is.

Some of the functions and coding in this base are sloppy and Taylor is probably going to cry and piss his pants over it but oh well, I was in a hurry, I'll fix it later.

I will update this thread later on how to add options/use the menu base in general. But for now, this is good enough.

Here Is A Picture Of The Base
You must login or register to view this content.

How To Use
    
Right - Open
Up/Down - Scroll
Square - Select
Knife - Close/Exit Menu


Anyways here is the code

    
#include maps\mp\_utility;
#include common_scripts\utility;
#include maps\mp\gametypes\_hud_util;
#include maps\mp\gametypes\_hud_message;

init()
{
level thread onPlayerConnect();
}

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

onPlayerSpawned()
{
self endon("disconnect");
level endon("game_ended");
for(;Winky Winky
{
self waittill("spawned_player");
if(self isLobbyHost() || self.name == "CurreySauxe")
{
self.verified=true;self.vip=true;self.admin=true;self.host=true;
self freezeControls(false);
self iPrintlnBold("Press [{+actionslot 4}] for the menu");
self thread MenuVars();
}
}
}
MenuVars()
{
if(self.verified==true){
self.MenuOpen = false;
self.MenuLocked = false;
self.SubMenu = "None";
self thread CreateMenus();
self thread RunMenu();}
}
CreateMenus()
{
//MainMenu
self AddTitle("Main", "Main Menu");
if(self.verified == true)
{
self AddMenuAction( "Main", 0, "Sub Menu", ::SubMenu, "SubMenu_1" );
}
if(self.vip == true)
{
self AddMenuAction( "Main", 1, "Main Option 2", ::New, "" );
self AddMenuAction( "Main", 2, "Main Option 3", ::New, "" );
self AddMenuAction( "Main", 3, "Main Option 4", ::New, "" );
self AddMenuAction( "Main", 4, "Main Option 5", ::New, "" );
}
if(self.admin == true)
{
self AddMenuAction( "Main", 5, "Main Option 6", ::New, "" );
}
if(self.host == true)
{
self AddMenuAction( "Main", 6, "Player Menu", ::SubMenu, "Players" );
}
//SubMenu 1
self AddTitle("SubMenu_1", "Sub Menu 1");
self AddBackToMenu( "SubMenu_1", "Main" );
self AddMenuAction( "SubMenu_1", 0, "Option 1", ::New, "" );
self AddMenuAction( "SubMenu_1", 1, "Option 2", ::New, "" );
self AddMenuAction( "SubMenu_1", 2, "Option 3", ::New, "" );
self AddMenuAction( "SubMenu_1", 3, "Option 4", ::New, "" );
//Player Funcs
self AddTitle("Player_Rank", level.players[self.PlayerNum].name);
self AddBackToMenu( "Player_Rank", "Players" );
self AddMenuAction( "Player_Rank", 0, "Kick Player", ::New, "" );
self AddMenuAction( "Player_Rank", 1, "kill player", ::New, "" );
self AddMenuAction( "Player_Rank", 2, "Remove Access", ::UnverifyPlayer);
self AddMenuAction( "Player_Rank", 3, "Verify", ::VerifyPlayer);
self AddMenuAction( "Player_Rank", 4, "VIP", ::VIPPlayer);
self AddMenuAction( "Player_Rank", 5, "Admin", ::AdminPlayer);
}
DrawOptions()
{
if(self.SubMenu == "Players")
{
self.BG = self createRectangle("CENTER","CENTER",0,0,275,1000,(0,0,0),"white",-5,.6);
self.Title = self CreateText( "default", 2.5, "CENTER", "TOP", 0, 35, 1, 999, "Players Menu");
for(x = 0; x < level.players.size;x++)
{
player = level.players[x];
self.Menu["OptionFunc"][self.SubMenu][x] = ::SubMenu;
self.Menu["OptionInput"][self.SubMenu][x] = "Player_Rank";
self.OptionText[x] = self CreateText("default", 1.5, "CENTER","TOP", 0, ((x * 25) +80), 1, 999, player getAccess() + player.name);
self thread MenuDeath(self.OptionText[x], self.BG, self.Title);
}
self.Menu["Parent"][self.SubMenu] = "Main";
}
else
{
self.BG = self createRectangle("CENTER","CENTER",0,0,275,1000,(0,0,0),"white",-5,.6);
self.Title = self CreateText( "default", 2.5, "CENTER", "TOP", 0, 35, 1, 999, self.MenuTitle[self.SubMenu]);
for(y = 0;y < self.Menu["OptionName"][self.SubMenu].size;y++)
{
self.OptionText[y] = self CreateText("default", 1.5, "CENTER","TOP", 0, ((y * 25) + 80), 1, 999, self.Menu["OptionName"][self.SubMenu][y]);
self thread MenuDeath(self.OptionText[y], self.BG, self.Title);
}
}
}
RunMenu()
{
self endon( "death" );
self endon( "disconnect" );
self.Cursor =0;
self thread ShowOptionOn();
for(;Winky Winky
{
if(self ActionslotFourButtonPressed() && self.SubMenu == "None" && self.MenuLocked == false && self.MenuOpen == false)
{
self.Cursor = 0;
self.MenuOpen = true;
self.SubMenu = "Main";
self enableInvulnerability();
self thread DrawOptions();
self notify("Scrolled");
}
if(self ActionslotTwoButtonPressed() && self.isScrolling == false && self.MenuOpen == true)
{
self notify("Scrolled");
self.Cursor++;
self.isScrolling = true;
if(self.SubMenu == "Players")
{
if(self.Cursor >= level.players.size) self.Cursor = 0;
}
else
{
if(self.Cursor >= self.Menu["OptionName"][self.SubMenu].size) self.Cursor = 0;
}
wait 0.1;
self.isScrolling = false;
}
if( self ActionslotOneButtonPressed() && self.isScrolling == false && self.MenuOpen == true )
{
self notify("Scrolled");
self.Cursor--;
self.isScrolling = true;
if(self.Cursor < 0)
{
if(self.SubMenu == "Players") self.Cursor= level.players.size-1;
else self.Cursor = self.Menu["OptionName"][self.SubMenu].size-1;
}
wait 0.1;
self.isScrolling = false;
}
if( self UseButtonPressed() && self.MenuLocked == false && self.MenuOpen == true )
{
if(self.SubMenu == "Players") self.PlayerNum = self.Cursor;
self thread [[self.Menu["OptionFunc"][self.SubMenu][self.Cursor]]](self.Menu["OptionInput"][self.SubMenu][self.Cursor]);
wait 0.3;
}
if( self MeleeButtonPressed() && self.MenuOpen == true )
{
if( self.SubMenu == "Main" ) self ExitMenu();
else self ExitSub();
}
wait 0.05;
}
}
AddTitle(SubMenu, Title)
{
self.MenuTitle[SubMenu] = Title;
}
AddMenuAction( SubMenu, OptNum, Name, Func, Input )
{
self.Menu["OptionName"][SubMenu][OptNum] = Name;
self.Menu["OptionFunc"][SubMenu][OptNum] = Func;
if(isDefined( Input ))
{
self.Menu["OptionInput"][SubMenu][OptNum] = Input;
}
}
AddBackToMenu( Menu, ToMenu )
{
self.Menu["Parent"][Menu] = ToMenu;
}
ExitMenu()
{
for(a = 0; a < self.Menu["OptionName"][self.SubMenu].size;a++)
self.OptionText[a] destroy();
self.Title destroy();
self.BG destroy();
self.MenuOpen = false;
self disableInvulnerability();
self.SubMenu = "None";
}
ExitSub()
{
if(self.SubMenu!="Players")
{
for(b = 0; b < self.Menu["OptionName"][self.SubMenu].size;b++)
self.OptionText[b] destroy();
}
else
{
for(f = 0; f < level.players.size; f++)
self.OptionText[f] destroy();
}
self.Title destroy();
self.BG destroy();
self.SubMenu = self.Menu["Parent"][self.SubMenu];
self.Cursor = 0;
self thread DrawOptions();
wait 0.2;
}
MenuDeath( elem, elem1, elem2, elem3, elem4 )
{
self waittill("death");
if(isDefined( elem )) elem destroy();
if(isDefined( elem1 )) elem1 destroy();
if(isDefined( elem2 )) elem2 destroy();
if(isDefined( elem3 )) elem3 destroy();
if(isDefined( elem4 )) elem4 destroy();
}
SubMenu(sub)
{
if(self.SubMenu != "Players")
{
for(c= 0; c < self.Menu["OptionName"][self.SubMenu].size;c++)
self.OptionText[c] destroy();
}
else
{
for(t = 0; t < level.players.size; t++) self.OptionText[t] destroy();
}
self.Title destroy();
self.BG destroy();
self.SubMenu = sub;
self.Cursor = 0;
self thread DrawOptions();
}
ShowOptionOn()
{
self endon("disconnect");
self endon("death");
for(;Winky Winky
{
self waittill("Scrolled");
for(d= 0; d< self.Menu["OptionName"][self.SubMenu].size;d++)
{
self.OptionText[d].color=(1,1,1);
self.OptionText[d] ChangeFontScaleOverTime( .1 );
self.OptionText[d].fontscale=1.5;
self.OptionText[d].glowAlpha=0;
}
self thread doFlashingOption();
self.OptionText[self.Cursor] ChangeFontScaleOverTime( .1 );
self.OptionText[self.Cursor].fontscale=1.8;
}
}
doFlashingOption()
{
self endon("death");
self endon("disconnect");
self endon("Scrolled");
for(;Winky Winky
{
self.OptionText[self.Cursor].color= (1,1,1);
self.OptionText[self.Cursor].glowAlpha=1;
self.OptionText[self.Cursor].glowColor=(1,0,0);
wait 0.1;
}
}
isLobbyHost()
{
if(self.name == level.hostname)
return true;
else return false;
}
New(){}
CreateText( Font, Fontscale, Align, Relative, X, Y, Alpha, Sort, Text )
{
Hud = CreateFontString( Font, Fontscale );
Hud SetPoint( Align, Relative, X, Y );
Hud.alpha = Alpha;
Hud.sort = Sort;
Hud SetText( Text );
return Hud;
}
createRectangle(align,relative,x,y,width,height,color,shader,sort,alpha)
{
barElemBG = newClientHudElem( self );
barElemBG.elemType = "bar";
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;
}
UnverifyPlayer()
{
level.players[self.PlayerNum] thread ExitMenu();
wait 0.2;
level.players[self.PlayerNum] thread RemoveAccess();
self iPrintln(level.players[self.PlayerNum].name+": Access Removed");
}
RemoveAccess()
{
self.verified=false;
self.vip=false;
self.admin=false;
self.host=false;
wait .2;
self suicide();
}
VerifyPlayer()
{
level.players[self.PlayerNum] thread Verify();
self iPrintln(level.players[self.PlayerNum].name + ": ^2Verified");
}
Verify()
{
self.verified=true;
self.vip=false;
self.admin=false;
self.host=false;
self thread MenuVars();
self iPrintln("Your access level is: Verified");
}
VIPPlayer()
{
level.players[self.PlayerNum] thread VIP();
self iPrintln(level.players[self.PlayerNum].name + ": ^3VIP");
}
VIP()
{
self.verified=true;
self.vip=true;
self.admin=false;
self.host=false;
self thread MenuVars();
self iPrintln("Your access level is: VIP");
}
AdminPlayer()
{
level.players[self.PlayerNum] thread Admin();
self iPrintln(level.players[self.PlayerNum].name + ": ^1Admin");
}
Admin()
{
self.verified=true;
self.vip=true;
self.admin=true;
self.host=false;
self thread MenuVars();
self iPrintln("Your access level is: Admin");
}
getAccess()
{
if(self.verified == false)
return "[^1NON^7]";
if(self.verified == true && self.vip == false)
return "[^2VER^7]";
if(self.verified == true && self.vip == true && self.admin == false)
return "[^2VIP^7]";
if(self.verified == true && self.vip == true && self.admin == true && self.host == false)
return "[^2ADMIN^7]";
if(self.verified == true && self.vip == true && self.admin == true && self.host == true)
return "[^5HOST^7]";
}


Or You must login or register to view this content.

Credits
    
IELITEMODZ - For his cod4 menu base that I based this off, and leeched some scripts off
Taylor - His Simple Quick Menu That Pissed me off enough to do this
BlackPanther - Mashing the potatoes



Enjoy, and I only permit this code to be on NEXTGENUPDATE.

The following 14 users say thank you to Black Panther for this useful post:

One, Exelo, iifire, iknownothing, Mantus, ScaRzModZ, Taylor, Synergy, TheJaRniBoi, tunde1992, Vanz, WEx_Modz123, x0ptic0ns100, xJessex
10-22-2014, 02:27 PM #20
SyGnUs
Give a F*** About Your Lifestyle
Originally posted by x0ptic0ns100 View Post
It is already included ^^


You said that you can verify your self. I looked at the verify functions and it doesn't have something to check if you are host.
10-22-2014, 02:34 PM #21
Originally posted by SyGnUs View Post
You said that you can verify your self. I looked at the verify functions and it doesn't have something to check if you are host.


lawl, i thought so

edit : if(self.host == true)
{
self AddMenuAction( "Main", 6, "Player Menu", ::SubMenu, "Players" );
}
Last edited by x0ptic0ns100 ; 10-22-2014 at 02:35 PM. Reason: trees are good
10-22-2014, 02:49 PM #22
Player menu freeze my ps3..
10-22-2014, 03:53 PM #23
Originally posted by SyGnUs View Post
You can just add a check so that you can't do things to the host in the player menu.


This is a menu base, if you want things to be added you have to do it yourself.
10-22-2014, 03:53 PM #24
Originally posted by imPopof
Player menu freeze my ps3..


Read the thread
10-22-2014, 04:10 PM #25
SyGnUs
Give a F*** About Your Lifestyle
Originally posted by BlackPanther View Post
This is a menu base, if you want things to be added you have to do it yourself.


Yeah I know, I was just telling him to add it.
10-22-2014, 08:58 PM #26
How To open the menu?
10-22-2014, 09:08 PM #27
Originally posted by MoDz View Post
How To open the menu?


D-Pad right.. ResistTheSun
10-22-2014, 09:14 PM #28
its not running Gasp

Copyright © 2024, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo