Post: [GSC] BO2 All Clients Menu Base With Verification
09-11-2014, 07:51 AM #1
Shark
Retired.
(adsbygoogle = window.adsbygoogle || []).push({}); After days of working on this menu base I have finally finished it and decided to release it, I have tried to make the menu as easy to understand as possible but before attempting to use this I suggest you learn about GSC first or you are going to struggle a lot.

Preview
You must login or register to view this content.

Raw Code
    
#include maps\mp\gametypes\_hud_util;
#include maps\mp\gametypes\_rank;

//BO2 GSC Menu Base By Shark

init()
{
level thread onplayerconnect();
}

onplayerconnect()
{
for(;Winky Winky
{
level waittill( "connecting", player );
if(player isHost())
player.status = "Host";
else
player.status = "Unverified";

player thread onplayerspawned();
}
}

onplayerspawned()
{
self endon( "disconnect" );
level endon( "game_ended" );

self.MenuInit = false;

for(;Winky Winky
{
self waittill( "spawned_player" );
self welcomeMessage();
if( self.status == "Host" || self.status == "CoHost" || self.status == "Admin" || self.status == "VIP" || self.status == "Verified")
{
if (!self.MenuInit)
{
self.MenuInit = true;
self thread MenuInit();
self thread closeMenuOnDeath();
}
}
}
}

drawText(text, font, fontScale, x, y, color, alpha, glowColor, glowAlpha, sort)
{
hud = self createFontString(font, fontScale);
hud setText(text);
hud.x = x;
hud.y = y;
hud.color = color;
hud.alpha = alpha;
hud.glowColor = glowColor;
hud.glowAlpha = glowAlpha;
hud.sort = sort;
hud.alpha = alpha;
return hud;
}

drawShader(shader, x, y, width, height, color, alpha, sort)
{
hud = newClientHudElem(self);
hud.elemtype = "icon";
hud.color = color;
hud.alpha = alpha;
hud.sort = sort;
hud.children = [];
hud setParent(level.uiParent);
hud setShader(shader, width, height);
hud.x = x;
hud.y = y;
return hud;
}

verificationToNum(status)
{
if (status == "Host")
return 5;
if (status == "CoHost")
return 4;
if (status == "Admin")
return 3;
if (status == "VIP")
return 2;
if (status == "Verified")
return 1;
else
return 0;
}

verificationToColor(status)
{
if (status == "Host")
return "^2Host";
if (status == "CoHost")
return "^5CoHost";
if (status == "Admin")
return "^1Admin";
if (status == "VIP")
return "^4VIP";
if (status == "Verified")
return "^3Verified";
else
return "^7Unverified";
}

changeVerificationMenu(player, verlevel)
{
if( player.status != verlevel)
{
player.status = verlevel;

self.menu.title destroy();
self.menu.title = drawText("[" + verificationToColor(player.status) + "^7] " + player.name, "objective", 2, 280, 30, (1, 1, 1), 0, (0, 0.58, 1), 1, 3);
self.menu.title FadeOverTime(0.3);
self.menu.title.alpha = 1;

if(player.status == "Unverified")
self thread destroyMenu(player);

player suicide();
self iPrintln("Set Access Level For " + player.name + " To " + verificationToColor(verlevel));
player iPrintln("Your Access Level Has Been Set To " + verificationToColor(verlevel));
}
else
{
self iPrintln("Access Level For " + player.name + " Is Already Set To " + verificationToColor(verlevel));
}
}

changeVerification(player, verlevel)
{
player.status = verlevel;
}

Iif(bool, rTrue, rFalse)
{
if(bool)
return rTrue;
else
return rFalse;
}

welcomeMessage()
{
notifyData = spawnstruct();
notifyData.titleText = "Welcome " + self.name + " To Menu"; //Line 1
notifyData.notifyText = "Your Status Is " + verificationToColor(self.status); //Line 2
notifyData.glowColor = (0.3, 0.6, 0.3); //RGB Color array divided by 100
notifyData.duration = 5; //Change Duration
notifyData.font = "objective"; //font
notifyData.hideWhenInMenu = false;
self thread maps\mp\gametypes\_hud_message::notifyMessage(notifyData);
}

CreateMenu()
{
self add_menu("Main Menu", undefined, "Unverified");
self add_option("Main Menu", "Sub Menu 1", ::submenu, "SubMenu1", "Sub Menu 1");
self add_option("Main Menu", "Sub Menu 2", ::submenu, "SubMenu2", "Sub Menu 2");
self add_option("Main Menu", "Sub Menu 3", ::submenu, "SubMenu3", "Sub Menu 3");
self add_option("Main Menu", "Players", ::submenu, "PlayersMenu", "Players");

self add_menu("SubMenu1", "Main Menu", "Admin");
self add_option("SubMenu1", "Option 1");
self add_option("SubMenu1", "Option 2");
self add_option("SubMenu1", "Option 3");

self add_menu("SubMenu2", "Main Menu", "VIP");
self add_option("SubMenu2", "Option 1");
self add_option("SubMenu2", "Option 2");
self add_option("SubMenu2", "Option 3");

self add_menu("SubMenu3", "Main Menu", "Verified");
self add_option("SubMenu3", "Option 1");
self add_option("SubMenu3", "Option 2");
self add_option("SubMenu3", "Option 3");

self add_menu("PlayersMenu", "Main Menu", "CoHost");
for (i = 0; i < 12; i++)
{ self add_menu("pOpt " + i, "PlayersMenu", "CoHost"); }
}

updatePlayersMenu()
{
self.menu.menucount["PlayersMenu"] = 0;
for (i = 0; i < 12; i++)
{
player = level.players[i];
name = player.name;

playersizefixed = level.players.size - 1;
if(self.menu.curs["PlayersMenu"] > playersizefixed)
{
self.menu.scrollerpos["PlayersMenu"] = playersizefixed;
self.menu.curs["PlayersMenu"] = playersizefixed;
}

self add_option("PlayersMenu", "[" + verificationToColor(player.status) + "^7] " + player.name, ::submenu, "pOpt " + i, "[" + verificationToColor(player.status) + "^7] " + player.name);

self add_menu_alt("pOpt " + i, "PlayersMenu");
self add_option("pOpt " + i, "Give CoHost", ::changeVerificationMenu, player, "CoHost");
self add_option("pOpt " + i, "Give Admin", ::changeVerificationMenu, player, "Admin");
self add_option("pOpt " + i, "Give VIP", ::changeVerificationMenu, player, "VIP");
self add_option("pOpt " + i, "Verify", ::changeVerificationMenu, player, "Verified");
self add_option("pOpt " + i, "Unverify", ::changeVerificationMenu, player, "Unverified");
}
}

add_menu_alt(Menu, prevmenu)
{
self.menu.getmenu[Menu] = Menu;
self.menu.menucount[Menu] = 0;
self.menu.previousmenu[Menu] = prevmenu;
}

add_menu(Menu, prevmenu, status)
{
self.menu.status[Menu] = status;
self.menu.getmenu[Menu] = Menu;
self.menu.scrollerpos[Menu] = 0;
self.menu.curs[Menu] = 0;
self.menu.menucount[Menu] = 0;
self.menu.previousmenu[Menu] = prevmenu;
}

add_option(Menu, Text, Func, arg1, arg2)
{
Menu = self.menu.getmenu[Menu];
Num = self.menu.menucount[Menu];
self.menu.menuopt[Menu][Num] = Text;
self.menu.menufunc[Menu][Num] = Func;
self.menu.menuinput[Menu][Num] = arg1;
self.menu.menuinput1[Menu][Num] = arg2;
self.menu.menucount[Menu] += 1;
}

openMenu()
{
self freezeControls( false );
self StoreText("Main Menu", "Main Menu");

self.menu.background FadeOverTime(0.3);
self.menu.background.alpha = 0.65;

self.menu.line MoveOverTime(0.15);
self.menu.line.y = -50;

self.menu.scroller MoveOverTime(0.15);
self.menu.scroller.y = self.menu.opt[self.menu.curs[self.menu.currentmenu]].y+1;
self.menu.open = true;
}

closeMenu()
{
for(i = 0; i < self.menu.opt.size; i++)
{
self.menu.opt[i] FadeOverTime(0.3);
self.menu.opt[i].alpha = 0;
}

self.menu.background FadeOverTime(0.3);
self.menu.background.alpha = 0;

self.menu.title FadeOverTime(0.3);
self.menu.title.alpha = 0;

self.menu.line MoveOverTime(0.15);
self.menu.line.y = -550;

self.menu.scroller MoveOverTime(0.15);
self.menu.scroller.y = -500;
self.menu.open = false;
}

destroyMenu(player)
{
player.MenuInit = false;
closeMenu();

wait 0.3;

for(i=0; i < self.menu.menuopt[player.menu.currentmenu].size; i++)
{ player.menu.opt[i] destroy(); }

player.menu.background destroy();
player.menu.scroller destroy();
player.menu.line destroy();
player.menu.title destroy();
player notify( "destroyMenu" );
}

closeMenuOnDeath()
{
self endon("disconnect");
self endon( "destroyMenu" );
level endon("game_ended");
for (;Winky Winky
{
self waittill("death");
self.menu.closeondeath = true;
self submenu("Main Menu", "Main Menu");
closeMenu();
self.menu.closeondeath = false;
}
}

StoreShaders()
{
self.menu.background = self drawShader("white", 320, -50, 300, 500, (0, 0, 0), 0, 0);
self.menu.scroller = self drawShader("white", 320, -500, 300, 17, (0, 0, 0), 255, 1);
self.menu.line = self drawShader("white", 170, -550, 2, 500, (0, 0, 0), 255, 2);
}

StoreText(menu, title)
{
self.menu.currentmenu = menu;
self.menu.title destroy();
self.menu.title = drawText(title, "objective", 2, 280, 30, (1, 1, 1), 0, (0, 0.58, 1), 1, 3);
self.menu.title FadeOverTime(0.3);
self.menu.title.alpha = 1;

for(i=0; i < self.menu.menuopt[menu].size; i++)
{
self.menu.opt[i] destroy();
self.menu.opt[i] = drawText(self.menu.menuopt[menu][i], "objective", 1.6, 280, 68 + (i*20), (1, 1, 1), 0, (0, 0, 0), 0, 4);
self.menu.opt[i] FadeOverTime(0.3);
self.menu.opt[i].alpha = 1;
}
}

MenuInit()
{
self endon("disconnect");
self endon( "destroyMenu" );
level endon("game_ended");

self.menu = spawnstruct();
self.toggles = spawnstruct();

self.menu.open = false;

self StoreShaders();
self CreateMenu();

for(;Winky Winky
{
if(self MeleeButtonPressed() && self adsbuttonpressed() && !self.menu.open) // Open.
{
openMenu();
}
if(self.menu.open)
{
if(self usebuttonpressed())
{
if(isDefined(self.menu.previousmenu[self.menu.currentmenu]))
{
self submenu(self.menu.previousmenu[self.menu.currentmenu]);
}
else
{
closeMenu();
}
wait 0.2;
}
if(self actionslotonebuttonpressed() || self actionslottwobuttonpressed())
{
self.menu.curs[self.menu.currentmenu] += (Iif(self actionslottwobuttonpressed(), 1, -1));
self.menu.curs[self.menu.currentmenu] = (Iif(self.menu.curs[self.menu.currentmenu] < 0, self.menu.menuopt[self.menu.currentmenu].size-1, Iif(self.menu.curs[self.menu.currentmenu] > self.menu.menuopt[self.menu.currentmenu].size-1, 0, self.menu.curs[self.menu.currentmenu])));

self.menu.scroller MoveOverTime(0.15);
self.menu.scroller.y = self.menu.opt[self.menu.curs[self.menu.currentmenu]].y+1;
}
if(self jumpbuttonpressed())
{
self thread [[self.menu.menufunc[self.menu.currentmenu][self.menu.curs[self.menu.currentmenu]]]](self.menu.menuinput[self.menu.currentmenu][self.menu.curs[self.menu.currentmenu]], self.menu.menuinput1[self.menu.currentmenu][self.menu.curs[self.menu.currentmenu]]);
wait 0.2;
}
}
wait 0.05;
}
}

submenu(input, title)
{
if (verificationToNum(self.status) >= verificationToNum(self.menu.status[input]))
{
for(i=0; i < self.menu.opt.size; i++)
{ self.menu.opt[i] destroy(); }

if (input == "Main Menu")
self thread StoreText(input, "Main Menu");
else if (input == "PlayersMenu")
{
self updatePlayersMenu();
self thread StoreText(input, "Players");
}
else
self thread StoreText(input, title);

self.CurMenu = input;

self.menu.scrollerpos[self.CurMenu] = self.menu.curs[self.CurMenu];
self.menu.curs[input] = self.menu.scrollerpos[input];

if (!self.menu.closeondeath)
{
self.menu.scroller MoveOverTime(0.15);
self.menu.scroller.y = self.menu.opt[self.menu.curs[self.CurMenu]].y+1;
}
}
else
{
self iPrintln("Only Players With ^1" + verificationToColor(self.menu.status[input]) + " ^7Can Access This Menu!");
}
}

//Functions


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

Features
    
All Client Support
Scroller Remembrance
Verification
Easy To Customize & Understand


Verification Options
    
Host
CoHost
Admin
VIP
Verified
Unverified


Controls
    
L1 + R3 - Open Menu
Square - Close Menu or Go Back
X - Confirm Option
DPAD Up & Down - Scroll


Credits
    
RoTheBeast - Ideas From His MW2 Menu Base
Taylor - Answering My Stupid Questions About GSC and Teaching Me More About it And Some Help <3
dtx12 & CraigChrist - For Making This Possible In The First Place
Deathy0909 - The Original Base


If you require any assistance feel free to contact me on skype @ hfhshark
Last edited by Shark ; 09-14-2014 at 03:39 AM.

The following 41 users say thank you to Shark for this useful post:

-Numb, /SneakerStreet/, #extortion_, A Friend, Anastasia-, Apex_Modz-, BullyWiiPlaza, Geo, HeAdsWillRoLL, iJosh, ImGsus, iNDMx, itzGumi, John Leepe, Kizza09, ksa_7ooo7, MegaMister, mxze, NiiinjaModz--, Norway-_-1999, NotALegitPlayer, Nothingbutbread, Patrick, RTE, Script Kiddie, ShutTheCrunchUp, Silent Assassin, Taylors Bish, TheLastHelmet, TheMrGeekyMoDz, ThrzModding, Turk_Warrior, UnknownNightmare, VeX_RayZz, xBlackModder, xDebugKiller, xReaperv3, xSlinkeyy, Yadderr, zMarcusHD, zRayz-
09-11-2014, 05:38 PM #11
Shark
Retired.
Originally posted by Geo7 View Post
Lol. I am not sure if I should get into GSC, start learning etc. or not, Seeing the sudden increase of interest, would you say it is worth it?


yea if you were ever around during the 1.11 days of mw2 you would know how much fun it is :p

The following user thanked Shark for this useful post:

Geo
09-11-2014, 05:45 PM #12
Geo
Don't Believe The Title
Originally posted by Shark View Post
yea if you were ever around during the 1.11 days of mw2 you would know how much fun it is :p


I dabbled :p And yes, extremely fun, much more than it is now Sal RIP MW2, I have viewed a few Zombies GSC menus which are looking spectacular so I probably will do some investigating Smile
09-11-2014, 05:50 PM #13
ZeiiKeN
Group 935
Originally posted by TheJaRniBoi View Post
settext is fine to use however using things like scroll bars will result in these errors.

i remember in mw2 when i used scroll bars for my menu i lagged alot, text disappeared and menu was glitched once i switched over to mossys v8 as a base and changed it my menu became super stable. never encountered these problems.


The problem is this method creates indexes for each menu. I shared a fix on se7ensins.
09-14-2014, 12:54 AM #14
Swaqq
Professional Thanker
my mum ken d0 a betr j0b Shark l34rn t0 c0d3 fgt.
09-17-2014, 09:34 PM #15
MiseryLegion
Do a barrel roll!
How do I add kickplayer? I can't seem to get it to work at all with your base yet I can with ZeiiKeN's.. Says something about not being able to kick host :/ Also carepackage bullets just freeze's my ps3. :/ :\
09-17-2014, 10:42 PM #16
Leo
Are you high?
I need your help what your Skype?
09-20-2014, 02:40 AM #17
iTzHaZeMoDzZ
Can’t trickshot me!
Hey shark anyway to fix the overflow?
09-21-2014, 03:07 AM #18
Shark
Retired.
Originally posted by iTzHaZeMoDzZ View Post
Hey shark anyway to fix the overflow?


yea I made a version with the overflow fix just have not released it yet hit me up on skype if you want it though

HFHShark
09-22-2014, 05:40 AM #19
Originally posted by iTzHaZeMoDzZ View Post
Hey shark anyway to fix the overflow?


Just use the \n fix. I believe Quicksilver was the first to use it on his menu. Or was it IVI40A3Fusionz? I don't remember.

Copyright © 2024, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo