Post: [Release] xYARDSALEx Menu Base w/ Built In Verification
10-12-2012, 12:17 AM #1
Taylor
Former Black Knight.
(adsbygoogle = window.adsbygoogle || []).push({});
This Is Something I Quickly Thrown Together, So Don't Judge If There Are Bugs, Because I Haven't Noticed Any..... Please Report Any If Found.... I Know It Is Very Simple, That's The Point

NOTE: There Is A Player Menu! While In The Menu Click L2 To Go Into The Player Menu.... And R2 To Go Back, Also Please Note This Does Not Use \n So Everytime You Scroll, It Re-Sets All The Text, So It's Using A LOT Of Strings..... So Do As You Wish With It, Use It Or Not, I Could Care Less, Anyway, Let's Get This Started:

Download(In Patch Form, Thanks To: primetime43):

You must login or register to view this content.


Video(Thanks To OmGRhys-x):



This NEEDS To Be Under onPlayerConnect():
    
if(player isHost())
{
player.status="Host";
}
else
{
player.status="Non";
}


Add This Under onPlayerSpawned() [Under The "self waittill("spawned_player");" Part...]:
    
if(self.status!="Non")
{
self entry();
}


The Menu Coding:
    
entry()
{
self.LockMenu=false;
self.CursMonitor=0;
self iPrintln("^"+randomInt(9)+"Press [{+Frag}] To Open The Menu! | Press [{+Frag}] And [{+smoke}] To Switch Menu!");
self.MenuIsOpen=undefined;
self thread doWelcome();
self AddMenuItems();
self thread ButtonHandling();
}
ButtonHandling()
{
self endon("death");
self endon("stopButtons");
for( ; ; )
{
if(self FragButtonPressed() && !isDefined(self.MenuIsOpen) && self.LockMenu==false)
{
self.MenuIsOpen=true;
self thread Menu("MainM");
self.BackGround = self createRectangle("LEFT", "", 125, 0, 270, 720, (0,0,0), "white", 1, 0.6);
self freezecontrols(true);
wait 0.2;
}
if(self FragButtonPressed() && isDefined(self.MenuIsOpen) && self.Yard["CurSub"]=="Players")
{
self thread Menu("MainM");
wait 0.2;
}
if(self SecondaryOffHandButtonPressed() && isDefined(self.MenuIsOpen) && self.Yard["CurSub"]=="MainM")
{
self thread Menu("Players");
wait 0.2;
}
if(self AdsButtonPressed() && isDefined(self.MenuIsOpen) && !isDefined(self.scrolling))
{
self.CursMonitor--;
self.scrolling=true;
if(self.CursMonitor < 0)
{
if(self.Yard["CurSub"] == "Players")
{
self.CursMonitor = level.players.size-1;
}
else
{
self.CursMonitor = self.Yard["Text"][self.Yard["CurSub"]].size-1;
}
}
self.scrolling=undefined;
self thread DrawOptions(self.Yard["CurSub"]);
wait 0.2;
}
if(self AttackButtonPressed() && isDefined(self.MenuIsOpen) && !isDefined(self.scrolling))
{
self.CursMonitor++;
self.scrolling=true;
if(self.Yard["CurSub"]=="Players")
{
if( self.CursMonitor >= level.players.size )
{
self.CursMonitor = 0;
}
}
else
{
if( self.CursMonitor >= self.Yard["Text"][self.Yard["CurSub"]].size )
{
self.CursMonitor = 0;
}
}
self.scrolling=undefined;
self thread DrawOptions(self.Yard["CurSub"]);
wait 0.2;
}
if(self MeleeButtonPressed() && isDefined(self.MenuIsOpen))
{
if(self.Yard["CurSub"]!="MainM" && self.Yard["CurSub"]!="Players")
self thread ExitSub();
else
self thread ExitMenu();

wait 0.2;
}
if(self UseButtonPressed() && isDefined(self.MenuIsOpen))
{
if(self.Yard["CurSub"] == "Players")
self.PNum = self.CursMonitor;

self thread [[self.Yard["Function"][self.Yard["CurSub"]][self.CursMonitor]]](self.Yard["Arg1"][self.Yard["CurSub"]][self.CursMonitor],self.Menu["Arg2"][self.Yard["CurSub"]][self.MenuMonitor]);
wait 0.2;
}
wait 0.01;
}
}
ExitSub()
{
if(self.Yard["CurSub"]=="Players"){for(i=0 ; i < level.players.size ; i++)self.MenuText[i] destroy();}else{for(K=0 ; K < self.Yard["Text"][self.Yard["CurSub"]].size; K++)self.MenuText[K] destroy();}
self thread Menu(self.Yard["ReturnMenu"][self.Yard["CurSub"]]);
self.CursMonitor=0;
}
ExitMenu()
{
if(self.Yard["CurSub"]=="Players"){for(i=0 ; i < level.players.size ; i++)self.MenuText[i] destroy();}else{for(K=0 ; K < self.Yard["Text"][self.Yard["CurSub"]].size; K++)self.MenuText[K] destroy();}
self.CursMonitor=0;
self.BackGround destroy();
self.MenuIsOpen=undefined;
self.Yard["CurSub"]=undefined;
self freezecontrols(false);
}
AddMenu( menu, num, optionText, function, Input, input2 )
{
self.Yard["Text"][menu][num] = optionText;
self.Yard["Function"][menu][num] = function;
if(isDefined(input))self.Yard["Arg1"][menu][num] = input;
if(isDefined(input))self.Yard["Arg2"][menu][num] = input2;
}
AddBack( CurMenu, BackMenu )
{
self.Yard["ReturnMenu"][CurMenu] = BackMenu;
}
Menu(sub)
{
if(self.Yard["CurSub"]=="Players"){for(i=0 ; i < level.players.size ; i++)self.MenuText[i] destroy();}else{for(K=0 ; K < self.Yard["Text"][self.Yard["CurSub"]].size; K++)self.MenuText[K] destroy();}
self.Yard["CurSub"]=sub;
self.CursMonitor=0;
self thread DrawOptions(sub);
}
DestroyOnDeathOrUnVerify(elem,elem1,elem2)
{
self waittill_any("death", "UnVerify");
elem destroy();
if(isDefined(elem1))elem1 destroy();
if(isDefined(elem2))elem2 destroy();
}
DrawOptions(menu)
{
if(self.Yard["CurSub"]=="Players"){for(i=0 ; i < level.players.size ; i++)self.MenuText[i] destroy();}else{for(K=0 ; K < self.Yard["Text"][self.Yard["CurSub"]].size; K++)self.MenuText[K] destroy();}
if(menu=="Players")
{
for(i=0 ; i < level.players.size ; i++)
{
player=level.players[i];
self.Yard["Function"][self.Yard["CurSub"]][i]=::Menu;
self.Yard["Arg1"][self.Yard["CurSub"]][i]="PlayerOpts";
self.MenuText[i] = self createFontString( "default", 1.5 );
self.MenuText[i].sort=99;
self.MenuText[i] setPoint( "TOPRIGHT", "TOPRIGHT", -50, ( i * 21.5 ) + 20 );
self.MenuText[i] setText( "["+player.status+"]"+player.name+"" );
if(i==self.CursMonitor)
{
self.MenuText[i] setPulseFX( 50, int(60000*1000), 100 );
self.MenuText[i] thread scaleFontOverTime(1.7,0.4);
self thread Flash(self.MenuText[i]);
}
self thread DestroyOnDeathOrUnVerify(self.MenuText[i], self.BackGround);
}
self.Yard["ReturnMenu"]["Players"]="MainM";
}
else
{
for(K=0 ; K < self.Yard["Text"][self.Yard["CurSub"]].size ; K++)
{
self.MenuText[K] = self createFontString( "default", 1.5 );
self.MenuText[K] setPoint( "TOPRIGHT", "TOPRIGHT", -50, ( K * 21.5 ) + 20 );
self.MenuText[K].sort=99;
self.MenuText[K] setText( self.Yard["Text"][self.Yard["CurSub"]][K] );
if(K==self.CursMonitor)
{
self.MenuText[K] setPulseFX( 50, int(60000*1000), 100 );
self.MenuText[K] thread scaleFontOverTime(2.0,0.4);
self thread Flash(self.MenuText[K]);
}
self notify("ReDraw");
self thread DestroyOnDeathOrUnVerify(self.MenuText[K], self.BackGround);
}
}
}
Flash(elem)
{
for( ; ; )
{
elem.color =(randomInt(255)/255, randomInt(255)/255, randomInt(255)/255);
wait 0.1;
}
}
scaleFontOverTime(size,time)
{
scaleSize =((size-self.fontScale)/(time*20));
for(k=0 ; k <(20*time) ; k++)
{
self.fontScale += scaleSize;
wait .05;
}
}
AddMenuItems()
{
self endon("stopButtons");
if(self.status=="Ver")
{
self AddMenu("MainM", 0, "Sub One", ::Menu, "Sub 1" );
self AddMenu("MainM", 1, "Option 2", ::test, "Potato" );
self AddMenu("MainM", 2, "Option 3", ::test, "Potato" );
}
if(self.status=="VIP")
{
self AddMenu("MainM", 0, "Sub One", ::Menu, "Sub 1" );
self AddMenu("MainM", 1, "Option 2", ::test, "Potato" );
self AddMenu("MainM", 2, "Option 3", ::test, "Potato" );
self AddMenu("MainM", 3, "Option 4", ::test, "Potato" );
self AddMenu("MainM", 4, "Option 5", ::test, "Potato" );
self AddMenu("MainM", 5, "Option 6", ::test, "Potato" );
}
if(self.status=="Admin")
{
self AddMenu("MainM", 0, "Sub One", ::Menu, "Sub 1" );
self AddMenu("MainM", 1, "Option 2", ::test, "Potato" );
self AddMenu("MainM", 2, "Option 3", ::test, "Potato" );
self AddMenu("MainM", 3, "Option 4", ::test, "Potato" );
self AddMenu("MainM", 4, "Option 5", ::test, "Potato" );
self AddMenu("MainM", 5, "Option 6", ::test, "Potato" );
self AddMenu("MainM", 6, "Option 7", ::test, "Potato" );
self AddMenu("MainM", 7, "Option 8", ::test, "Potato" );
}
if(self.status=="CoHost")
{
self AddMenu("MainM", 0, "Sub One", ::Menu, "Sub 1" );
self AddMenu("MainM", 1, "Option 2", ::test, "Potato" );
self AddMenu("MainM", 2, "Option 3", ::test, "Potato" );
self AddMenu("MainM", 3, "Option 4", ::test, "Potato" );
self AddMenu("MainM", 4, "Option 5", ::test, "Potato" );
self AddMenu("MainM", 5, "Option 6", ::test, "Potato" );
self AddMenu("MainM", 6, "Option 7", ::test, "Potato" );
self AddMenu("MainM", 7, "Option 8", ::test, "Potato" );
self AddMenu("MainM", 8, "Option 9", ::test, "Potato" );
self AddMenu("MainM", 9, "Option 10", ::test, "Potato" );
}
if(self.status=="Host")
{
self AddMenu("MainM", 0, "Sub One", ::Menu, "Sub 1" );
self AddMenu("MainM", 1, "Option 2", ::test, "Potato" );
self AddMenu("MainM", 2, "Option 3", ::test, "Potato" );
self AddMenu("MainM", 3, "Option 4", ::test, "Potato" );
self AddMenu("MainM", 4, "Option 5", ::test, "Potato" );
self AddMenu("MainM", 5, "Option 6", ::test, "Potato" );
self AddMenu("MainM", 6, "Option 7", ::test, "Potato" );
self AddMenu("MainM", 7, "Option 8", ::test, "Potato" );
self AddMenu("MainM", 8, "Option 9", ::test, "Potato" );
self AddMenu("MainM", 9, "Option 10", ::test, "Potato" );
self AddMenu("MainM", 10, "Option 11", ::test, "Potato" );
self AddMenu("MainM", 11, "Option 12", ::test, "Potato" );
}
self AddBack("Sub 1", "MainM");
self AddMenu("Sub 1", 0, "Option 1", ::test, "Potato" );
self AddMenu("Sub 1", 1, "Option 2", ::test, "Potato" );
self AddMenu("Sub 1", 2, "Option 3", ::test, "Potato" );
self AddMenu("Sub 1", 3, "Option 4", ::test, "Potato" );
self AddMenu("Sub 1", 4, "Option 5", ::test, "Potato" );
self AddMenu("Sub 1", 5, "Option 6", ::test, "Potato" );
self AddMenu("Sub 1", 6, "Option 7", ::test, "Potato" );
self AddMenu("Sub 1", 7, "Option 8", ::test, "Potato" );
self AddMenu("Sub 1", 8, "Option 9", ::test, "Potato" );
self AddMenu("Sub 1", 9, "Option 10", ::test, "Potato" );
self AddMenu("Sub 1", 10, "Option 11", ::test, "Potato" );
self AddMenu("Sub 1", 11, "Option 12", ::test, "Potato" );

self AddBack("PlayerOpts", "Players");
self AddMenu("PlayerOpts", 0, "Kill Player", ::Kill, "" );
self AddMenu("PlayerOpts", 1, "Kick Player", ::KickPlayer, "" );
self AddMenu("PlayerOpts", 2, "Un-Verify Player", ::doStatus, "Non" );
self AddMenu("PlayerOpts", 3, "Verify Player", ::doStatus, "Ver" );
self AddMenu("PlayerOpts", 4, "VIP Player", ::doStatus, "VIP" );
self AddMenu("PlayerOpts", 5, "Admin Player", ::doStatus, "Admin" );
self AddMenu("PlayerOpts", 6, "CoHost Player", ::doStatus, "CoHost" );
}
Kill()
{
player=level.players[self.PNum];
player suicide();
self iPrintln("^3"+player.name+" Has Been Suicided!");
}
doStatus(status)
{
player=level.players[self.PNum];
if(player isHost())
{
self iPrintln("^3You Cannot Do This To "+player.name);
}
else
{
player.status=status;
wait 0.1;
player.lockMenu=true;
player notify("stopButtons");
player notify("UnVerify");
player freezecontrols(false);
wait 0.1;
if(player.status!="Non"){player thread entry();player thread AddMenuItems();}
self iPrintln(player.name+"'s Status Is Now: "+status);
}
}
KickPlayer()
{
player=level.players[self.PNum];
self thread doStatus("Non"); //All This Over Here Is Necessary, Keep It All, Do Not Delete Any Of This Coding Or It Will Cause The Game To Crash
wait 0.3; //All This Over Here Is Necessary, Keep It All, Do Not Delete Any Of This Coding Or It Will Cause The Game To Crash
kick( player getEntityNumber(), "EXE_PLAYERKICKED" );
wait 0.1; //All This Over Here Is Necessary, Keep It All, Do Not Delete Any Of This Coding Or It Will Cause The Game To Crash
self thread Menu("Players"); //All This Over Here Is Necessary, Keep It All, Do Not Delete Any Of This Coding Or It Will Cause The Game To Crash
}
doWelcome()
{
if(!isDefined(self.welcome))
{
self.welcome=true;
self thread doWelcomeDisplay();
}
}
doWelcomeDisplay()
{
wait 1;
self setClientDvar( "ui_hud_hardcore", "1" );
self playLocalSound("mp_level_up");
self.Welcome=CreateFontString( "default", 1.6 );
self.Welcome setPoint( "TOPRIGHT", "TOPRIGHT", 250, 25 );
self.Welcome setText( "Access Level: "+self.status);
self.Welcome.glowAlpha=1;
self.Welcome.glowColor=(0.3, 0.6, 0.3);
self.Welcome setPulseFX( 100, int(60000*1000), 100 );
self.Welcome MoveOverTime(0.5);
self.Welcome.x=-15;
self.WelcomeText=CreateFontString( "objective", 1.5 );
self.WelcomeText setPoint( "TOPRIGHT", "TOPRIGHT", 250, 5 );
self.WelcomeText setText( "Welcome "+self.name+"! To PUT PATCH NAME HERE!" );
self.WelcomeText.glowAlpha=1;
self.WelcomeText.glowColor=(0.3, 0.6, 0.3);
self.WelcomeText setPulseFX( 50, int(60000*1000), 999999999999 );
self.WelcomeText MoveOverTime(0.5);
self.WelcomeText.x=-15;
self.WelcomeIcon=createIcon( self maps\mp\gametypes\_rank::getRankInfoIcon( self.pers["rank"], self.pers["prestige"] ), 60, 60 );
self.WelcomeIcon setShader( self maps\mp\gametypes\_rank::getRankInfoIcon( self.pers["rank"], self.pers["prestige"] ), 50, 50 );
self.WelcomeIcon setPoint( "TOPRIGHT", "TOPRIGHT", -15, 45 );
self.WelcomeIcon MoveOverTime(0.5);
self.WelcomeIcon.x=-15;
wait 3.5;
self setClientDvar( "ui_hud_hardcore", "0" );
thread DestroyElemsMw3(self.WelcomeIcon,self.Welcome,self.WelcomeText);
}
DestroyElemsMw3(elem1, elem2, elem3)
{
elem1 MoveOverTime(0.3);
elem1.x=250;
elem2 MoveOverTime(0.3);
elem2.x=250;
elem3 MoveOverTime(0.3);
elem3.x=500;
wait 1;
elem1 destroy();
elem2 destroy();
elem3 destroy();
}
test( arg )
{
self iPrintLn( arg );
}
Spawn_AI(numberOfTestClients)
{
level.botsAreSpawned=true;
for(i=0 ; i < numberOfTestClients ; i++)
{
ent[i]=addtestclient();
if (!isdefined(ent[i]))
{
wait 1;
continue;
}
ent[i].pers["isBot"]=true;
setDvar( "sv_botsRandomInput", "0" );
setDvar( "sv_botsPressAttackBtn", "0" );
ent[i] thread initIndividualBot("autoassign");
wait 0.1;
}
}
initIndividualBot(team)
{
self endon("disconnect");
while(!isdefined(self.pers["team"])) wait .05;
self notify("menuresponse",game["menu_team"],team);
wait 0.5;
classes=getArrayKeys(level.classMap);
okclasses=[];
for(i=0 ; i< classes.size ; i++)
{
if (!issubstr(classes[i],"custom") && isDefined(level.default_perk[level.classMap[classes[i]]])) okclasses[okclasses.size]=classes[i];
}
assert(okclasses.size);
while(1)
{
class=okclasses[randomint(okclasses.size)];
self notify("menuresponse","changeclass",class);
self waittill("spawned_player");
self notify("disconnect");
}
}
createRectangle(align,relative,x,y,width,height,color,shader,sort,alpha)
{
barElemBG = newClientHudElem( self );
barElemBG.elemType = "bar";
barElemBG.width = width;
barElemBG.height = height;
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.hideWhenInMenu = true;
barElemBG setPoint(align,relative,x,y);
barElemBG.align = align;
barElemBG.relative = relative;
return barElemBG;
}


I Hope You Enjoy, - Taylor
Last edited by Taylor ; 02-27-2013 at 11:45 PM.

The following 31 users say thank you to Taylor for this useful post:

Nath, .BrainzModding, Day, *xActionMods*, BvB-09r-_-N!c0, cali123, Choopie, ChromeVisionz, CrEaTiiOnUNREAL, forflah123, GetTangoed, GodofHosting, ITheHiddenZoneI, Jordan G., KCxFTW, Kitty=^.^=, Newelly, Oliver1556, OmGRhys-x, primetime43, RaspberryIce, say-say123, silentcobra22, UnHolyModz, Vampytwistッ, xePixTvx, xJewMoDz, xKrazeGods, xToysBoy_, Zuraa
10-19-2012, 10:34 PM #47
Ahhh imma use this. Good job Happy
10-19-2012, 10:37 PM #48
Devil Child
Error… Cat invasion!
Originally posted by xYARDSALEx View Post
Looks right, why?

y u no like me :LOL:
10-11-2013, 01:49 AM #49
i really love the base but the mediafire link is down, if anyone can send me the base over skype or something let me know
10-19-2013, 02:45 AM #50
GodofHosting
Bounty hunter
Nice job, Taylor Smile

Copyright © 2024, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo