Post: [RELEASE] IVI40A3Fusionz's Menu Base
01-31-2012, 09:31 PM #1
IVI40A3Fusionz
Former Gaming Squad Member
(adsbygoogle = window.adsbygoogle || []).push({});










Menu base coded 100% all by me Smile.
NOTE: I Will Be Taking The Same Approach As DConnor, I Will Not Be Providing Any Support For Later Versions, If You Have A Later Version And Have A Problem Please Fix It Yourself.

Video: (Update 2)


***What's New?***

***Update 2***
* Added Support For Verification.
* Fixed Verification Bug.
* Fixed A New Player Menu Bug Found By xRaw.
* Added Animation To Menu.

***Update 1.5***
* Added Support For Titles.
* Added Support For People Wanting To Have A Customize Menu Options.
* Fixed Player Menu Bug.

***Update 1***
* Added Verification.
* Added Player Menu.
* Added Overflow Fix (Helps Menu Be More Stable).
* Re-coded The Way The Menu Scrolls For Better Effect.

NOTE: In my opinion i think all W@W menu's should use the overflow fix so you don't waste all those text strings.


[multipage=Menu Base Without Titles]












Code:

    
BuildMenu()
{
self endon("disconnect");
self endon("unverified");
self.MenuOpen = false;
self thread iniMenu();
self.Menu["Background"] = CreateShader("CENTER", "CENTER", 550, 0, 390, 1000, (0,0,0), "white", 0, 1);
self.Menu["Scrollbar"] = CreateShader("CENTER", "CENTER", 550, -160, 390, 20, (1,0,0), "white", 1, 1);
for(;Winky Winky
{
if(self FragButtonPressed() && self.MenuOpen == false)
{
self freezecontrols(true);
self.Menu["Scrollbar"] MoveElem("x", 1, 250);
self.Menu["Background"] MoveElem("x", 1, 250);
self thread MenuText("Main");
self.Menu["MenuText"] MoveElem("x", 1, 60);
wait 1;
self.Menu["Cursor"] = 0;
self.Menu["Scrollbar"] MoveElem("y", .3, self.Menu["Cursor"]*24-160);
self.MenuOpen = true;
wait .1;
}
if(self UseButtonPressed() && self.MenuOpen == true)
{
if(self.Root == "PlayerM") self.PlayerFunctions = self.Menu["Cursor"];
self thread [[self.MenuFunction[self.Root][self.Menu["Cursor"]]]](self.MenuInput[self.Root][self.Menu["Cursor"]]);
wait .2;
}
if(self AdsButtonPressed() && self.MenuOpen == true)
{
self.Menu["Cursor"]--;
if(self.Menu["Cursor"]>self.MenuText[self.Root].size-1) self.Menu["Cursor"]=0;
if(self.Menu["Cursor"]<0) self.Menu["Cursor"]=self.MenuText[self.Root].size-1;
self.Menu["Scrollbar"] MoveElem("y", .3, self.Menu["Cursor"]*24-160);
wait .2;
}
if(self AttackButtonPressed() && self.MenuOpen == true)
{
self.Menu["Cursor"]++;
if(self.Menu["Cursor"]>self.MenuText[self.Root].size-1) self.Menu["Cursor"]=0;
if(self.Menu["Cursor"]<0) self.Menu["Cursor"]=self.MenuText[self.Root].size-1;
self.Menu["Scrollbar"] MoveElem("y", .3, self.Menu["Cursor"]*24-160);
wait .2;
}
if(self MeleeButtonPressed() && self.MenuOpen == true)
{
if(self.Root == "Main")
{
self.Menu["Scrollbar"] MoveElem("x", 1, 550);
self.Menu["Background"] MoveElem("x", 1, 550);
self.Menu["MenuText"] MoveElem("x", .985, 350);
wait 1;
self.Menu["MenuText"] destroy();
self freezecontrols(false);
self.MenuOpen = false;
}
else if(self.Root == "SubM1" || self.Root == "SubM2" || self.Root == "SubM3" || self.Root == "SubM4" || self.Root == "SubM5" || self.Root == "VIPM" || self.Root == "PlayerM" || self.Root == "AdminM" || self.Root == "HostM")
{
self thread NewMenu("Main");
}
else if(self.Root == "PlayerOpts")
{
self thread NewMenu("PlayerM");
}
wait .2;
}
wait 0.05;
}
}
CreateShader(align,relative,x,y,width,height,color,shader,sort,alpha)
{
CShader=newClientHudElem(self);
CShader.children=[];
CShader.elemType="bar";
CShader.sort=sort;
CShader.color=color;
CShader.alpha=alpha;
CShader setParent(level.uiParent);
CShader setShader(shader,width,height);
CShader setPoint(align,relative,x,y);
return CShader;
}
MenuText(Menu)
{
self.Root = Menu;
Text = "";
for( i=0;i<self.MenuText[Menu].size;i++ ) Text += self.MenuText[Menu][i]+"\n";
self.Menu["MenuText"] = createFontString("hud_small", 2, self);
self.Menu["MenuText"] setPoint("LEFT", "", 350, -160);
self.Menu["MenuText"] setText( Text );
self.Menu["MenuText"].alpha = 6;
self.Menu["MenuText"].sort = 15;
}
addMenu(Menu, Title)
{
self.TitleText[Menu] = Title;
}
addOption(Menu, Number, Text, Function, Input)
{
self.MenuText[Menu][Number] = Text;
self.MenuFunction[Menu][Number] = Function;
if(IsDefined(Input)) self.MenuInput[Menu][Number] = Input;
}
MoveElem(Axis, Time, Input)
{
self MoveOverTime(Time);
if(Axis == "x") self.x = Input;
else self.y = Input;
}
NewMenu(Menu)
{
self.Menu["MenuText"] destroy();
self thread MenuText(Menu);
self.Menu["MenuText"].x = 60;
self.Menu["Cursor"] = 0;
self.Menu["Scrollbar"] MoveElem("y", .3, self.Menu["Cursor"]*24-160);
}
MonitorPlayers()
{
self endon("disconnect");
for(;Winky Winky
{
for(p = 0;p < level.players.size;p++)
{
player = level.players[p];
self.MenuText["PlayerM"][p] = player.name;
self.MenuFunction["PlayerM"][p] = ::NewMenu;
self.MenuInput["PlayerM"][p] = "PlayerOpts";
wait .01;
}
wait .5;
}
}
iniMenu()
{
if(self.Verified == true)
{
addOption("Main", 0, "Sub Menu 1", ::NewMenu, "SubM1");
addOption("Main", 1, "Sub Menu 2", ::NewMenu, "SubM2");
addOption("Main", 2, "Sub Menu 3", ::NewMenu, "SubM3");
addOption("Main", 3, "Sub Menu 4", ::NewMenu, "SubM4");
addOption("Main", 4, "Sub Menu 5", ::NewMenu, "SubM5");
}
if(self.VIP == true)
{
addOption("Main", 5, "VIP Menu", ::NewMenu, "VIPM");
}
if(self.Admin == true)
{
addOption("Main", 6, "Player Menu", ::NewMenu, "PlayerM");
addOption("Main", 7, "Admin Menu", ::NewMenu, "AdminM");
}
if(self GetEntityNumber() == 0)
{
addOption("Main", 8, "Host Menu", ::NewMenu, "HostM");
}

addOption("SubM1", 0, "Sub Option 1", ::Test, "1");
addOption("SubM1", 1, "Sub Option 2", ::Test, "2");
addOption("SubM1", 2, "Sub Option 3", ::Test, "3");
addOption("SubM1", 3, "Sub Option 4", ::Test, "4");
addOption("SubM1", 4, "Sub Option 5", ::Test, "5");

addOption("SubM2", 0, "Sub Option 1", ::Test, "1");
addOption("SubM2", 1, "Sub Option 2", ::Test, "2");
addOption("SubM2", 2, "Sub Option 3", ::Test, "3");
addOption("SubM2", 3, "Sub Option 4", ::Test, "4");
addOption("SubM2", 4, "Sub Option 5", ::Test, "5");

addOption("SubM3", 0, "Sub Option 1", ::Test, "1");
addOption("SubM3", 1, "Sub Option 2", ::Test, "2");
addOption("SubM3", 2, "Sub Option 3", ::Test, "3");
addOption("SubM3", 3, "Sub Option 4", ::Test, "4");
addOption("SubM3", 4, "Sub Option 5", ::Test, "5");

addOption("SubM4", 0, "Sub Option 1", ::Test, "1");
addOption("SubM4", 1, "Sub Option 2", ::Test, "2");
addOption("SubM4", 2, "Sub Option 3", ::Test, "3");
addOption("SubM4", 3, "Sub Option 4", ::Test, "4");
addOption("SubM4", 4, "Sub Option 5", ::Test, "5");

addOption("SubM5", 0, "Sub Option 1", ::Test, "1");
addOption("SubM5", 1, "Sub Option 2", ::Test, "2");
addOption("SubM5", 2, "Sub Option 3", ::Test, "3");
addOption("SubM5", 3, "Sub Option 4", ::Test, "4");
addOption("SubM5", 4, "Sub Option 5", ::Test, "5");

addOption("VIPM", 0, "Sub Option 1", ::Test, "1");
addOption("VIPM", 1, "Sub Option 2", ::Test, "2");
addOption("VIPM", 2, "Sub Option 3", ::Test, "3");
addOption("VIPM", 3, "Sub Option 4", ::Test, "4");
addOption("VIPM", 4, "Sub Option 5", ::Test, "5");

for(p = 0;p < level.players.size;p++)
{
player = level.players[p];
addOption("PlayerM", p, player.name, ::NewMenu, "PlayerOpts");
}
self thread MonitorPlayers();

addOption("AdminM", 0, "Sub Option 1", ::Test, "1");
addOption("AdminM", 1, "Sub Option 2", ::Test, "2");
addOption("AdminM", 2, "Sub Option 3", ::Test, "3");
addOption("AdminM", 3, "Sub Option 4", ::Test, "4");
addOption("AdminM", 4, "Sub Option 5", ::Test, "5");

addOption("HostM", 0, "Sub Option 1", ::Test, "1");
addOption("HostM", 1, "Sub Option 2", ::Test, "2");
addOption("HostM", 2, "Sub Option 3", ::Test, "3");
addOption("HostM", 3, "Sub Option 4", ::Test, "4");
addOption("HostM", 4, "Sub Option 5", ::Test, "5");

addOption("PlayerOpts", 0, "Kick Player", ::Kick, "");
addOption("PlayerOpts", 1, "[Un]Verify Player", ::Verify, "");
addOption("PlayerOpts", 2, "VIP Player", ::VIP, "");
addOption("PlayerOpts", 3, "Admin Player", ::Admin, "");
addOption("PlayerOpts", 4, "Sub Option 5", ::Test, "5");
}
Test(Value)
{
self iPrintln("^2Sub Option "+Value);
}
Kick()
{
kick(level.players[self.PlayerFunctions] GetEntityNumber());
self thread NewMenu("PlayerM");
}

Verify()
{
player = level.players[self.PlayerFunctions];
if(player GetEntityNumber() == 0)
{
self iPrintln("^1"+level.hostname+" Cannot Be Un-Verified!");
}
else
{
if(player.Verified == false || player.VIP == false || player.Admin == false)
{
player.Verified = true;
player.VIP = false;
player.Admin = false;
player thread BuildMenu();
}
else if(player.Verified == true || player.VIP == true || player.Admin == true)
{
player notify("unverified");
player.Verified = false;
player.VIP = false;
player.Admin = false;
}
}
self thread NewMenu("PlayerM");
}
VIP()
{
player = level.players[self.PlayerFunctions];
if(player GetEntityNumber() == 0)
{
self iPrintln("^1"+level.hostname+" Verification Rank Cannot Be Changed");
}
else if(player.VIP == false)
{
if(player.Verified == false || player.Admin == false)
{
player.Verified = true;
player.VIP = true;
player.Admin = false;
player thread BuildMenu();
}
}
self thread NewMenu("PlayerM");
}
Admin()
{
player = level.players[self.PlayerFunctions];
if(player GetEntityNumber() == 0)
{
self iPrintln("^1"+level.hostname+" Verification Rank Cannot Be Changed");
}
else if(player.Admin == false)
{
if(player.Verified == false || player.VIP == false)
{
player.Verified = true;
player.VIP = true;
player.Admin = true;
player thread BuildMenu();
}
}
self thread NewMenu("PlayerM");
}



You'll need to thread,
    
if(self GetEntityNumber() == 0)
{
self freezecontrols(false);
self thread BuildMenu();
self.Verified = true;
self.VIP = true;
self.Admin = true;
}

On onplayerspawned.



[multipage=Menu Base With Titles]












Code:

    
BuildMenu()
{
self endon("disconnect");
self endon("unverified");
self.MenuOpen = false;
self thread iniMenu();
self.Menu["Background"] = CreateShader("CENTER", "CENTER", 550, 0, 390, 1000, (0,0,0), "white", 0, 1);
self.Menu["Scrollbar"] = CreateShader("CENTER", "CENTER", 550, -160, 390, 20, (1,0,0), "white", 1, 1);
for(;Winky Winky
{
if(self FragButtonPressed() && self.MenuOpen == false)
{
self freezecontrols(true);
self.Menu["Scrollbar"] MoveElem("x", 1, 250);
self.Menu["Background"] MoveElem("x", 1, 250);
self thread MenuText("Main");
self.Menu["MenuText"] MoveElem("x", 1, 60);
self.Menu["Title"] MoveElem("x", 1, 180);
wait 1;
self.Menu["Cursor"] = 0;
self.Menu["Scrollbar"] MoveElem("y", .3, self.Menu["Cursor"]*24-160);
self.MenuOpen = true;
wait .1;
}
if(self UseButtonPressed() && self.MenuOpen == true)
{
if(self.Root == "PlayerM") self.PlayerFunctions = self.Menu["Cursor"];
self thread [[self.MenuFunction[self.Root][self.Menu["Cursor"]]]](self.MenuInput[self.Root][self.Menu["Cursor"]]);
wait .2;
}
if(self AdsButtonPressed() && self.MenuOpen == true)
{
self.Menu["Cursor"]--;
if(self.Menu["Cursor"]>self.MenuText[self.Root].size-1) self.Menu["Cursor"]=0;
if(self.Menu["Cursor"]<0) self.Menu["Cursor"]=self.MenuText[self.Root].size-1;
self.Menu["Scrollbar"] MoveElem("y", .3, self.Menu["Cursor"]*24-160);
wait .2;
}
if(self AttackButtonPressed() && self.MenuOpen == true)
{
self.Menu["Cursor"]++;
if(self.Menu["Cursor"]>self.MenuText[self.Root].size-1) self.Menu["Cursor"]=0;
if(self.Menu["Cursor"]<0) self.Menu["Cursor"]=self.MenuText[self.Root].size-1;
self.Menu["Scrollbar"] MoveElem("y", .3, self.Menu["Cursor"]*24-160);
wait .2;
}
if(self MeleeButtonPressed() && self.MenuOpen == true)
{
if(self.Root == "Main")
{
self.Menu["Scrollbar"] MoveElem("x", 1, 550);
self.Menu["Background"] MoveElem("x", 1, 550);
self.Menu["MenuText"] MoveElem("x", .985, 350);
self.Menu["Title"] MoveElem("x", .985, 450);
wait 1;
self.Menu["MenuText"] destroy();
self.Menu["Title"] destroy();
self freezecontrols(false);
self.MenuOpen = false;
}
else if(self.Root == "SubM1" || self.Root == "SubM2" || self.Root == "SubM3" || self.Root == "SubM4" || self.Root == "SubM5" || self.Root == "VIPM" || self.Root == "PlayerM" || self.Root == "AdminM" || self.Root == "HostM")
{
self thread NewMenu("Main");
}
else if(self.Root == "PlayerOpts")
{
self thread NewMenu("PlayerM");
}
wait .2;
}
wait 0.05;
}
}
CreateShader(align,relative,x,y,width,height,color,shader,sort,alpha)
{
CShader=newClientHudElem(self);
CShader.children=[];
CShader.elemType="bar";
CShader.sort=sort;
CShader.color=color;
CShader.alpha=alpha;
CShader setParent(level.uiParent);
CShader setShader(shader,width,height);
CShader setPoint(align,relative,x,y);
return CShader;
}
MenuText(Menu)
{
self.Root = Menu;
Text = "";
for( i=0;i<self.MenuText[Menu].size;i++ ) Text += self.MenuText[Menu][i]+"\n";
self.Menu["MenuText"] = createFontString("hud_small", 2, self);
self.Menu["MenuText"] setPoint("LEFT", "", 350, -160);
self.Menu["MenuText"] setText( Text );
self.Menu["MenuText"].alpha = 6;
self.Menu["MenuText"].sort = 15;
self.Menu["Title"] = createFontString("hud_small", 2.5, self);
self.Menu["Title"] setPoint("CENTER", "", 450, -200);
self.Menu["Title"] setText( self.TitleText[Menu] );
self.Menu["Title"].alpha = 6;
self.Menu["Title"].sort = 15;
}
addMenu(Menu, Title)
{
self.TitleText[Menu] = Title;
}
addOption(Menu, Number, Text, Function, Input)
{
self.MenuText[Menu][Number] = Text;
self.MenuFunction[Menu][Number] = Function;
if(IsDefined(Input)) self.MenuInput[Menu][Number] = Input;
}
MoveElem(Axis, Time, Input)
{
self MoveOverTime(Time);
if(Axis == "x") self.x = Input;
else self.y = Input;
}
NewMenu(Menu)
{
self.Menu["MenuText"] destroy();
self.Menu["Title"] destroy();
self thread MenuText(Menu);
self.Menu["MenuText"].x = 60;
self.Menu["Title"].x = 180;
self.Menu["Cursor"] = 0;
self.Menu["Scrollbar"] MoveElem("y", .3, self.Menu["Cursor"]*24-160);
}
MonitorPlayers()
{
self endon("disconnect");
for(;Winky Winky
{
for(p = 0;p < level.players.size;p++)
{
player = level.players[p];
self.MenuText["PlayerM"][p] = player.name;
self.MenuFunction["PlayerM"][p] = ::NewMenu;
self.MenuInput["PlayerM"][p] = "PlayerOpts";
wait .01;
}
wait .5;
}
}
iniMenu()
{
addMenu("Main", "Main Menu");
if(self.Verified == true)
{
addOption("Main", 0, "Sub Menu 1", ::NewMenu, "SubM1");
addOption("Main", 1, "Sub Menu 2", ::NewMenu, "SubM2");
addOption("Main", 2, "Sub Menu 3", ::NewMenu, "SubM3");
addOption("Main", 3, "Sub Menu 4", ::NewMenu, "SubM4");
addOption("Main", 4, "Sub Menu 5", ::NewMenu, "SubM5");
}
if(self.VIP == true)
{
addOption("Main", 5, "VIP Menu", ::NewMenu, "VIPM");
}
if(self.Admin == true)
{
addOption("Main", 6, "Player Menu", ::NewMenu, "PlayerM");
addOption("Main", 7, "Admin Menu", ::NewMenu, "AdminM");
}
if(self GetEntityNumber() == 0)
{
addOption("Main", 8, "Host Menu", ::NewMenu, "HostM");
}

addMenu("SubM1", "Sub Menu 1");
addOption("SubM1", 0, "Sub Option 1", ::Test, "1");
addOption("SubM1", 1, "Sub Option 2", ::Test, "2");
addOption("SubM1", 2, "Sub Option 3", ::Test, "3");
addOption("SubM1", 3, "Sub Option 4", ::Test, "4");
addOption("SubM1", 4, "Sub Option 5", ::Test, "5");

addMenu("SubM2", "Sub Menu 2");
addOption("SubM2", 0, "Sub Option 1", ::Test, "1");
addOption("SubM2", 1, "Sub Option 2", ::Test, "2");
addOption("SubM2", 2, "Sub Option 3", ::Test, "3");
addOption("SubM2", 3, "Sub Option 4", ::Test, "4");
addOption("SubM2", 4, "Sub Option 5", ::Test, "5");

addMenu("SubM3", "Sub Menu 3");
addOption("SubM3", 0, "Sub Option 1", ::Test, "1");
addOption("SubM3", 1, "Sub Option 2", ::Test, "2");
addOption("SubM3", 2, "Sub Option 3", ::Test, "3");
addOption("SubM3", 3, "Sub Option 4", ::Test, "4");
addOption("SubM3", 4, "Sub Option 5", ::Test, "5");

addMenu("SubM4", "Sub Menu 4");
addOption("SubM4", 0, "Sub Option 1", ::Test, "1");
addOption("SubM4", 1, "Sub Option 2", ::Test, "2");
addOption("SubM4", 2, "Sub Option 3", ::Test, "3");
addOption("SubM4", 3, "Sub Option 4", ::Test, "4");
addOption("SubM4", 4, "Sub Option 5", ::Test, "5");

addMenu("SubM5", "Sub Menu 5");
addOption("SubM5", 0, "Sub Option 1", ::Test, "1");
addOption("SubM5", 1, "Sub Option 2", ::Test, "2");
addOption("SubM5", 2, "Sub Option 3", ::Test, "3");
addOption("SubM5", 3, "Sub Option 4", ::Test, "4");
addOption("SubM5", 4, "Sub Option 5", ::Test, "5");

addMenu("VIPM", "VIP Menu");
addOption("VIPM", 0, "Sub Option 1", ::Test, "1");
addOption("VIPM", 1, "Sub Option 2", ::Test, "2");
addOption("VIPM", 2, "Sub Option 3", ::Test, "3");
addOption("VIPM", 3, "Sub Option 4", ::Test, "4");
addOption("VIPM", 4, "Sub Option 5", ::Test, "5");

addMenu("PlayerM", "Player Menu");
for(p = 0;p < level.players.size;p++)
{
player = level.players[p];
addOption("PlayerM", p, player.name, ::NewMenu, "PlayerOpts");
}
self thread MonitorPlayers();

addMenu("AdminM", "Admin Menu");
addOption("AdminM", 0, "Sub Option 1", ::Test, "1");
addOption("AdminM", 1, "Sub Option 2", ::Test, "2");
addOption("AdminM", 2, "Sub Option 3", ::Test, "3");
addOption("AdminM", 3, "Sub Option 4", ::Test, "4");
addOption("AdminM", 4, "Sub Option 5", ::Test, "5");

addMenu("HostM", "Host Menu");
addOption("HostM", 0, "Sub Option 1", ::Test, "1");
addOption("HostM", 1, "Sub Option 2", ::Test, "2");
addOption("HostM", 2, "Sub Option 3", ::Test, "3");
addOption("HostM", 3, "Sub Option 4", ::Test, "4");
addOption("HostM", 4, "Sub Option 5", ::Test, "5");

addMenu("PlayerOpts", "Do Something!");
addOption("PlayerOpts", 0, "Kick Player", ::Kick, "");
addOption("PlayerOpts", 1, "[Un]Verify Player", ::Verify, "");
addOption("PlayerOpts", 2, "VIP Player", ::VIP, "");
addOption("PlayerOpts", 3, "Admin Player", ::Admin, "");
addOption("PlayerOpts", 4, "Sub Option 5", ::Test, "5");
}
Test(Value)
{
self iPrintln("^2Sub Option "+Value);
}
Kick()
{
kick(level.players[self.PlayerFunctions] GetEntityNumber());
self thread NewMenu("PlayerM");
}

Verify()
{
player = level.players[self.PlayerFunctions];
if(player GetEntityNumber() == 0)
{
self iPrintln("^1"+level.hostname+" Cannot Be Un-Verified!");
}
else
{
if(player.Verified == false || player.VIP == false || player.Admin == false)
{
player.Verified = true;
player.VIP = false;
player.Admin = false;
player thread BuildMenu();
}
else if(player.Verified == true || player.VIP == true || player.Admin == true)
{
player notify("unverified");
player.Verified = false;
player.VIP = false;
player.Admin = false;
}
}
self thread NewMenu("PlayerM");
}
VIP()
{
player = level.players[self.PlayerFunctions];
if(player GetEntityNumber() == 0)
{
self iPrintln("^1"+level.hostname+" Verification Rank Cannot Be Changed");
}
else if(player.VIP == false)
{
if(player.Verified == false || player.Admin == false)
{
player.Verified = true;
player.VIP = true;
player.Admin = false;
player thread BuildMenu();
}
}
self thread NewMenu("PlayerM");
}
Admin()
{
player = level.players[self.PlayerFunctions];
if(player GetEntityNumber() == 0)
{
self iPrintln("^1"+level.hostname+" Verification Rank Cannot Be Changed");
}
else if(player.Admin == false)
{
if(player.Verified == false || player.VIP == false)
{
player.Verified = true;
player.VIP = true;
player.Admin = true;
player thread BuildMenu();
}
}
self thread NewMenu("PlayerM");
}



You'll need to thread,
    
if(self GetEntityNumber() == 0)
{
self freezecontrols(false);
self thread BuildMenu();
self.Verified = true;
self.VIP = true;
self.Admin = true;
}

On onplayerspawned.
Last edited by IVI40A3Fusionz ; 03-17-2012 at 01:47 PM.

The following 8 users say thank you to IVI40A3Fusionz for this useful post:

Baby-panama, BlazingDope, cadpimp1289, Correy, forflah123, iPROFamily, Kearney158, Taylor
02-07-2012, 11:22 PM #2
coolbunny1234
the bunny who started it all
Nice, my question for you is how do you test mp patches on pc?
02-08-2012, 04:39 PM #3
IVI40A3Fusionz
Former Gaming Squad Member
Originally posted by coolbunny1234 View Post
Nice, my question for you is how do you test mp patches on pc?


You test zombie patches on PC right? If so it's just the same way as doing it for zombies except you have to put mp_THENYOURPATCHNAME Smile.
02-08-2012, 09:48 PM #4
IVI40A3Fusionz
Former Gaming Squad Member
Updated menu base, please check under Update 1 to see what i've done Smile.
The look of the menu on screen is still the same so there is no need for a new video.
02-08-2012, 09:50 PM #5
Taylor
Former Black Knight.
Originally posted by IVI40A3Fusionz View Post
Well, my 'Soooo Stooooned' Patch is taking alot of time as i can't code much more it due to exams but i will resume editing and adding to it after 10th February (Half Term). But i had a bit of time around 30 minutes spare time so i decided to resume editing on my patch all i done was add infections menu and all players menu i then went on to make a menu base just to show i can make scripts and other stuff.

***Update 1***
* Added Verification.
* Added Player Menu.
* Added Overflow Fix (Helps Menu Be More Stable).
*Re-coded The Way The Menu Scrolls For Better Effect.

NOTE: In my opinion i think all W@W menu's should use the overflow fix so you don't waste all those text strings.

Video:


Code:

    
BuildMenu()
{
self.Menu["Cursor"] = 0;
self.MenuOpen = false;
self thread iniMenu();
for(;Winky Winky
{
if(self FragButtonPressed() && self.MenuOpen == false)
{
self freezecontrols(true);
self.Menu["Background"] = CreateShader("CENTER", "CENTER", 250, 0, 390, 1000, (0,0,0), "white", 0, 1);
self.Menu["Scrollbar"] = CreateShader("CENTER", "CENTER", 250, -160, 390, 20, (1,0,0), "white", 1, 1);
self thread MenuText("Main");
self.MenuOpen = true;
wait .1;
}
if(self UseButtonPressed() && self.MenuOpen == true)
{
self thread [[self.MenuFunction[self.Root][self.Menu["Cursor"]]]](self.MenuInput[self.Root][self.Menu["Cursor"]]);
wait .2;
}
if(self AdsButtonPressed() && self.MenuOpen == true)
{
self.Menu["Cursor"]--;
if(self.Menu["Cursor"]>self.MenuText[self.Root].size-1) self.Menu["Cursor"]=0;
if(self.Menu["Cursor"]<0) self.Menu["Cursor"]=self.MenuText[self.Root].size-1;
self.Menu["Scrollbar"] moveOverTime(.3);
self.Menu["Scrollbar"].y=self.Menu["Cursor"]*24-160;
wait .2;
}
if(self AttackButtonPressed() && self.MenuOpen == true)
{
self.Menu["Cursor"]++;
if(self.Menu["Cursor"]>self.MenuText[self.Root].size-1) self.Menu["Cursor"]=0;
if(self.Menu["Cursor"]<0) self.Menu["Cursor"]=self.MenuText[self.Root].size-1;
self.Menu["Scrollbar"] moveOverTime(.3);
self.Menu["Scrollbar"].y=self.Menu["Cursor"]*24-160;
wait .2;
}
if(self MeleeButtonPressed() && self.MenuOpen == true)
{
if(self.Root == "Main")
{
self freezecontrols(false);
self.Menu["Background"] destroy();
self.Menu["Scrollbar"] destroy();
self.Menu["MenuText"] destroy();
self.MenuOpen = false;
}
else if(self.Root == "SubM1" || self.Root == "SubM2" || self.Root == "SubM3" || self.Root == "SubM4" || self.Root == "SubM5" || self.Root == "VIPM" || self.Root == "PlayerM" || self.Root == "AdminM" || self.Root == "HostM")
{
self thread NewMenu("Main");
}
else if(self.Root == "PlayerOpts")
{
self thread NewMenu("PlayerM");
}
wait .2;
}
wait 0.05;
}
}
CreateShader(align,relative,x,y,width,height,color,shader,sort,alpha)
{
CShader=newClientHudElem(self);
CShader.children=[];
CShader.elemType="bar";
CShader.sort=sort;
CShader.color=color;
CShader.alpha=alpha;
CShader setParent(level.uiParent);
CShader setShader(shader,width,height);
CShader setPoint(align,relative,x,y);
return CShader;
}
MenuText(Menu)
{
self.Root = Menu;
Text = "";
for( i=0;i<self.MenuText[Menu].size;i++ ) Text += self.MenuText[Menu][i]+"\n";
self.Menu["MenuText"] = createFontString("hud_small", 2, self);
self.Menu["MenuText"] setPoint("LEFT", "CENTER", 60, -160);
self.Menu["MenuText"] setText( Text );
self.Menu["MenuText"].alpha = 6;
self.Menu["MenuText"].sort = 15;
}
addOption(Menu, Number, Text, Function, Input)
{
self.MenuText[Menu][Number] = Text;
self.MenuFunction[Menu][Number] = Function;
if(IsDefined(Input)) self.MenuInput[Menu][Number] = Input;
}
NewMenu(Menu)
{
self.Menu["MenuText"] destroy();
self thread MenuText(Menu);
self.Menu["Cursor"] = 0;
self.Menu["Scrollbar"] moveOverTime(.3);
self.Menu["Scrollbar"].y=self.Menu["Cursor"]*24-160;
}
iniMenu()
{
addOption("Main", 0, "Sub Menu 1", ::NewMenu, "SubM1");
addOption("Main", 1, "Sub Menu 2", ::NewMenu, "SubM2");
addOption("Main", 2, "Sub Menu 3", ::NewMenu, "SubM3");
addOption("Main", 3, "Sub Menu 4", ::NewMenu, "SubM4");
addOption("Main", 4, "Sub Menu 5", ::NewMenu, "SubM5");
if(self.VIP == true)
{
addOption("Main", 5, "VIP Menu", ::NewMenu, "VIPM");
}
if(self.Admin == true)
{
addOption("Main", 6, "Player Menu", ::NewMenu, "PlayerM");
addOption("Main", 7, "Admin Menu", ::NewMenu, "AdminM");
}
if(self GetEntityNumber() == 0)
{
addOption("Main", 8, "Host Menu", ::NewMenu, "HostM");
}

addOption("SubM1", 0, "Sub Option 1", ::Test, "1");
addOption("SubM1", 1, "Sub Option 2", ::Test, "2");
addOption("SubM1", 2, "Sub Option 3", ::Test, "3");
addOption("SubM1", 3, "Sub Option 4", ::Test, "4");
addOption("SubM1", 4, "Sub Option 5", ::Test, "5");

addOption("SubM2", 0, "Sub Option 1", ::Test, "1");
addOption("SubM2", 1, "Sub Option 2", ::Test, "2");
addOption("SubM2", 2, "Sub Option 3", ::Test, "3");
addOption("SubM2", 3, "Sub Option 4", ::Test, "4");
addOption("SubM2", 4, "Sub Option 5", ::Test, "5");

addOption("SubM3", 0, "Sub Option 1", ::Test, "1");
addOption("SubM3", 1, "Sub Option 2", ::Test, "2");
addOption("SubM3", 2, "Sub Option 3", ::Test, "3");
addOption("SubM3", 3, "Sub Option 4", ::Test, "4");
addOption("SubM3", 4, "Sub Option 5", ::Test, "5");

addOption("SubM4", 0, "Sub Option 1", ::Test, "1");
addOption("SubM4", 1, "Sub Option 2", ::Test, "2");
addOption("SubM4", 2, "Sub Option 3", ::Test, "3");
addOption("SubM4", 3, "Sub Option 4", ::Test, "4");
addOption("SubM4", 4, "Sub Option 5", ::Test, "5");

addOption("SubM5", 0, "Sub Option 1", ::Test, "1");
addOption("SubM5", 1, "Sub Option 2", ::Test, "2");
addOption("SubM5", 2, "Sub Option 3", ::Test, "3");
addOption("SubM5", 3, "Sub Option 4", ::Test, "4");
addOption("SubM5", 4, "Sub Option 5", ::Test, "5");

addOption("VIPM", 0, "Sub Option 1", ::Test, "1");
addOption("VIPM", 1, "Sub Option 2", ::Test, "2");
addOption("VIPM", 2, "Sub Option 3", ::Test, "3");
addOption("VIPM", 3, "Sub Option 4", ::Test, "4");
addOption("VIPM", 4, "Sub Option 5", ::Test, "5");

for( p = 0;p < level.players.size;p++ )
{
player = level.players[p];
addOption("PlayerM", p, player.name, ::NewMenu, "PlayerOpts");
}

addOption("AdminM", 0, "Sub Option 1", ::Test, "1");
addOption("AdminM", 1, "Sub Option 2", ::Test, "2");
addOption("AdminM", 2, "Sub Option 3", ::Test, "3");
addOption("AdminM", 3, "Sub Option 4", ::Test, "4");
addOption("AdminM", 4, "Sub Option 5", ::Test, "5");

addOption("HostM", 0, "Sub Option 1", ::Test, "1");
addOption("HostM", 1, "Sub Option 2", ::Test, "2");
addOption("HostM", 2, "Sub Option 3", ::Test, "3");
addOption("HostM", 3, "Sub Option 4", ::Test, "4");
addOption("HostM", 4, "Sub Option 5", ::Test, "5");

addOption("PlayerOpts", 0, "Kick Player", ::Kick, "");
addOption("PlayerOpts", 1, "[Un]Verify Player", ::Verify, "");
addOption("PlayerOpts", 2, "VIP Player", ::VIP, "");
addOption("PlayerOpts", 3, "Admin Player", ::Admin, "");
addOption("PlayerOpts", 4, "Sub Option 5", ::Test, "5");
}
Test(Value)
{
self iPrintln("^2Sub Option "+Value);
}
Kick()
{
kick( level.players[self.Menu["Cursor"]] getEntityNumber(), "EXE_PLAYERKICKED" );
}
Verify()
{
player = level.players[self.Menu["Cursor"]];
if(player GetEntityNumber() == 0)
{
self iPrintln("^1"+level.hostname+" Cannot Be Un-Verified!");
}
else
{
if(player.Verified == false)
{
player.Verified = true;
player thread BuildMenu();
}
else
{
player notify("unverified");
player.Verified = false;
player.VIP = false;
player.Admin = false;
}
}
}
VIP()
{
player = level.players[self.Menu["Cursor"]];
if(player GetEntityNumber() == 0)
{
self iPrintln("^1"+level.hostname+" Verification Rank Cannot Be Changed");
}
else if(player.VIP == false)
{
if(player.Verified == false)
{
player thread BuildMenu();
player.Verified = true;
player.VIP = true;
player.Admin = false;
}
}
}
Admin()
{
player = level.players[self.Menu["Cursor"]];
if(player GetEntityNumber() == 0)
{
self iPrintln("^1"+level.hostname+" Verification Rank Cannot Be Changed");
}
else if(player.Admin == false)
{
if(player.Verified == false)
{
player thread BuildMenu();
player.Verified = true;
player.VIP = true;
player.Admin = true;
}
}
}



You'll need to thread,
    
if(self GetEntityNumber() == 0)
{
self freezecontrols(false);
self thread BuildMenu();
self.VIP = true;
self.Admin = true;
}

On onplayerspawned.


Its Gayyyy :carling:

The following user thanked Taylor for this useful post:

xRaW
02-08-2012, 09:51 PM #6
IVI40A3Fusionz
Former Gaming Squad Member
Originally posted by xYARDSALEx View Post
Its Gayyyy :carling:


Just like you then Taylor my good man :carling:
02-09-2012, 12:02 AM #7
Taylor
Former Black Knight.
Originally posted by IVI40A3Fusionz View Post
Just like you then Taylor my good man :carling:


Dear Ryan, i am very offended by ur reply to my comment, i am just honestly voicing my opinion, and u reply in a violent/horrible/offensive way, i am very offended by this, so with these few last words, i ask you kindly my dear sir to please stop....... Love, Your Secret Admirer.......(Taylor)
02-09-2012, 03:41 PM #8
Overflow fix.... You do realise W@W doesn't string overflow right?
02-09-2012, 03:44 PM #9
IVI40A3Fusionz
Former Gaming Squad Member
Originally posted by nZxMikeeeyx View Post
Overflow fix.... You do realise W@W doesn't string overflow right?


Not by the looks of it :/. xRaw and some other people have manage to get their patch to overflow on PS3.

EDIT: You must login or register to view this content.
02-10-2012, 09:48 PM #10
IVI40A3Fusionz
Former Gaming Squad Member
Updated Menu Base, please check what i've added if your interested. I've fixed a few bugs thanks to xRaw for finding them.

P.S. The video is of update 2 with titles, the menu without titles is just the same just without titles obviously.

Copyright © 2024, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo