Post: [Updated] - Micro Menu v2
10-27-2011, 06:06 PM #1
Correy
I'm the Original
(adsbygoogle = window.adsbygoogle || []).push({}); i've made alot of improvements since the last version!

    
- it now supports sub menu's
- addOption Function for the long term effect.
- Coding is more clean.
- it navigates back from sub menu's
- added inputs for the menus


make sure you have this at the top of your gsc or it will not work.
    
#include maps\mp\_utility;
#include maps\mp\gametypes\_hud_util;



here's the coding.. which is actually v2.1
    
MicroMenu()
{ self thread maps\mp\gametypes\_hud_message:GaspldNotifyMessage( "Welcome "+self.name, "Micro Menu v2!" );
self.Correy["Menu"]["Current"] = "Main";
self GetOptions();
for( self.Correy["Menu"]["Curs"] = 0;; )
{ self.Correy["Menu"]["Curs"] = self.self.Correy["Menu"]["Curs"];
self setLowerMessage( self.Correy["Menu"]["Options"][self.Correy["Menu"]["Current"]][self.Correy["Menu"]["Curs"]] );
self.Correy["Menu"]["Curs"] += self attackButtonPressed();
self.Correy["Menu"]["Curs"] -= self adsButtonPressed();
if( self useButtonPressed() ){ self thread [[self.Func[self.Correy["Menu"]["Current"]][self.Correy["Menu"]["Curs"]]]]( self.Correy["Menu"]["Input"][self.Correy["Menu"]["Current"]][self.Correy["Menu"]["Curs"]] ); wait 1; }
if( self meleeButtonPressed() ){ if (self.Correy["Menu"]["Current"] != "Main Menu") self loadMenu( "Main" ); }else{ break; }
if( self.Correy["Menu"]["Curs"] < 0 ) self.Correy["Menu"]["Curs"] = self.Correy["Menu"]["Options"].size-1;
if( self.Correy["Menu"]["Curs"] > self.Correy["Menu"]["Options"].size-1 ) self.Correy["Menu"]["Curs"] = 0;
wait ( self useButtonPressed() )*.2+( self adsButtonPressed() )*.2+(self attackButtonPressed())*.2+.05;
}
self clearLowerMessage();
self MicroMenu();
}
addOption( menu, name, func, input )
{ self.Correy["Menu"]["Number"] = self.Correy["Menu"]["Options"][menu].size;
self.Correy["Menu"]["Options"][menu][self.Correy["Menu"]["Number"]] = name;
self.Func[menu][self.Correy["Menu"]["Number"]] = func;
if( isDefined( input ))
{
self.Correy["Menu"]["Input"][menu][self.Correy["Menu"]["Number"]] = input;
}
}
GetOptions()
{ self addOption( "Main", "Players Menu", ::loadMenu, "sub1" );
self addOption( "Main", "Sub Menu 2", ::loadMenu, "sub2" );
self addOption( "Main", "Sub Menu 3", ::loadMenu, "sub3" );
self addOption( "sub1", "Option 1", ::test );
self addOption( "sub2", "Option 1", ::test );
self addOption( "sub3", "Option 1", ::test );
}
loadMenu( menu )
{ self.Correy["Menu"]["Current"] = menu;
self clearLowerMessage();
wait .1;
self setLowerMessage(self.Correy["Menu"]["Options"][self.Correy["Menu"]["Current"]][self.self.Correy["Menu"]["Curs"]]);
}
test(){}


if your not pretty sure how to use it here's a syntax version of how to add menus and options.
    
self addOption( < your menu name it belongs to> , < Option name >, ::loadMenu, < menu name to load> );


here's a syntax version of adding Options
    
self addOption( <menu it belongs to> , <the option name>, ::<function>, <your input>


remember, inputs aren't needed so if there's no input just leave it out.

thanks to
- Blackstorms addOption function, even though i coded my own.
- Zy0n and the creators of the Kick menu which i built this off.
(adsbygoogle = window.adsbygoogle || []).push({});

The following 5 users say thank you to Correy for this useful post:

cadpimp1289, IVI40A3Fusionz, Jeremy, User2340034u
10-27-2011, 09:38 PM #11
Correy
I'm the Original
Originally posted by 247Yamato View Post
Just taken a look and I see here an error, :P : inp-input. And to make it shorter you can take this: self thread [[self.Func[self.Menu][curs]]](self.Input[self.Menu][curs]); and transform it into: [[self.Func[self.Menu][curs]]](self.Input[self.Menu][curs]); . If you want extra small thing: put s = self; and put s in every self(just to make it shorter). Also, getoptions() is not needed, just put the addoptions in the main thread.

addOption( menu, num, name, func, inp )
{ self.Menu[num] = menu;
self.Name[num] = name;
self.Func[num] = func;
if(isDefined(input))
{
self.Input = input;
}
}


ha, good notice.. changed it..

---------- Post added at 10:38 PM ---------- Previous post was at 10:37 PM ----------

Originally posted by 247Yamato View Post
Just taken a look and I see here an error, :P : inp-input. And to make it shorter you can take this: self thread [[self.Func[self.Menu][curs]]](self.Input[self.Menu][curs]); and transform it into: [[self.Func[self.Menu][curs]]](self.Input[self.Menu][curs]); . If you want extra small thing: put s = self; and put s in every self(just to make it shorter). Also, getoptions() is not needed, just put the addoptions in the main thread.

addOption( menu, num, name, func, inp )
{ self.Menu[num] = menu;
self.Name[num] = name;
self.Func[num] = func;
if(isDefined(input))
{
self.Input = input;
}
}


oh and i added the thread incase another variable was been used and the _getOptions is to make it more clearer Smile
10-28-2011, 01:47 AM #12
xKtF
In my man cave
nice but we could add more sub menus?:wtf:
10-28-2011, 02:11 AM #13
Correy
I'm the Original
Originally posted by infinitycl View Post
nice but we could add more sub menus?:wtf:


yep, do it as i showed Smile
10-28-2011, 02:35 AM #14
INSAN3LY_D34TH
INSAN3LY GAMING
Originally posted by Correy View Post
i've made alot of improvements since the last version!

    
- it now supports sub menu's
- addOption Function for the long term effect.
- Coding is more clean.
- it navigates back from sub menu's
- added inputs for the menus


make sure you have this at the top of your gsc or it will not work.
#include maps\mp\_utility;
#include maps\mp\gametypes\_hud_util;
[/code]


here's the coding..
    
MicroMenu()
{ self waittill("night_vision_on");
self thread hintText( "Welcome "+self.name, "Micro Menu v2!");
self.Menu = "Main Menu";
self GetOptions();
for(curs = 0;Winky Winky
{ curs= self.curs;
self setLowerMessage(self.Name[self.Menu][curs]);
curs += self attackButtonPressed();
curs -= self adsButtonPressed();
if(self useButtonPressed()){ self thread [[self.Func[self.Menu][curs]]](self.Input[self.Menu][curs]); wait 1; }
if(self meleeButtonPressed()){ if (self.M != "Main Menu") self loadMenu("Main Menu"); }else{ break; }
if(curs<0) curs = self.Name.size-1;
if(curs>self.Name.size-1) curs = 0;
wait (self useButtonPressed())*.2+(self adsButtonPressed())*.2+(self attackButtonPressed())*.2+.05;
}
self clearLowerMessage();
self MicroMenu();
}
addOption( menu, num, name, func, input )
{ self.Menu[num] = menu;
self.Name[num] = name;
self.Func[num] = func;
if(isDefined(input))
{
self.Input = input;
}
}
GetOptions()
{ self addOption("Main", "Sub Menu 1", ::loadMenu, "sub1");
self addOption("Main", "Sub Menu 2", ::loadMenu, "sub2");
self addOption("Main", "Sub Menu 3", ::loadMenu, "sub3");
self addOption("sub1", "Option 1", ::test);
self addOption("sub2", "Option 1", ::test);
self addOption("sub3", "Option 1", ::test);
}
loadMenu( menu )
{ self.M = menu;
self clearLowerMessage();
wait .1;
self setLowerMessage(self.Name[self.Menu][self.curs]);
}
hintText( text, text1 )
{
if (isDefined(text1))
{ self maps\mp\gametypes\_hud_message:GaspldNotifyMessage(text,text2);
}else
{ self maps\mp\gametypes\_hud_message:GaspldNotifyMessage(text);
}
}
test(){}


if your not pretty sure how to use it here's a syntax version of how to add menus and options.
    
self addOption( < your menu name it belongs to> , < Option name >, ::loadMenu, < menu name to load> );


here's a syntax version of adding Options
    
self addOption( <menu it belongs to> , <the option name>, ::<function>, <your input>


remember, inputs aren't needed so if there's no input just leave it out.

thanks to
- Blackstorms addOption function, even though i coded my own.
- Zy0n and the creators of the Kick menu which i built this off.


i have the menu on my computer, but when i turn night vision on nothing happens, it loads the vision but no menu. even tried scrolling
10-28-2011, 02:53 AM #15
Default Avatar
iMLB
Guest
Originally posted by Correy View Post
i've made alot of improvements since the last version!

    
- it now supports sub menu's
- addOption Function for the long term effect.
- Coding is more clean.
- it navigates back from sub menu's
- added inputs for the menus


make sure you have this at the top of your gsc or it will not work.
#include maps\mp\_utility;
#include maps\mp\gametypes\_hud_util;
[/code]


here's the coding..
    
MicroMenu()
{ self waittill("night_vision_on");
self thread hintText( "Welcome "+self.name, "Micro Menu v2!");
self.Menu = "Main Menu";
self GetOptions();
for(curs = 0;Winky Winky
{ curs= self.curs;
self setLowerMessage(self.Name[self.Menu][curs]);
curs += self attackButtonPressed();
curs -= self adsButtonPressed();
if(self useButtonPressed()){ self thread [[self.Func[self.Menu][curs]]](self.Input[self.Menu][curs]); wait 1; }
if(self meleeButtonPressed()){ if (self.M != "Main Menu") self loadMenu("Main Menu"); }else{ break; }
if(curs<0) curs = self.Name.size-1;
if(curs>self.Name.size-1) curs = 0;
wait (self useButtonPressed())*.2+(self adsButtonPressed())*.2+(self attackButtonPressed())*.2+.05;
}
self clearLowerMessage();
self MicroMenu();
}
addOption( menu, num, name, func, input )
{ self.Menu[num] = menu;
self.Name[num] = name;
self.Func[num] = func;
if(isDefined(input))
{
self.Input = input;
}
}
GetOptions()
{ self addOption("Main", "Sub Menu 1", ::loadMenu, "sub1");
self addOption("Main", "Sub Menu 2", ::loadMenu, "sub2");
self addOption("Main", "Sub Menu 3", ::loadMenu, "sub3");
self addOption("sub1", "Option 1", ::test);
self addOption("sub2", "Option 1", ::test);
self addOption("sub3", "Option 1", ::test);
}
loadMenu( menu )
{ self.M = menu;
self clearLowerMessage();
wait .1;
self setLowerMessage(self.Name[self.Menu][self.curs]);
}
hintText( text, text1 )
{
if (isDefined(text1))
{ self maps\mp\gametypes\_hud_message:GaspldNotifyMessage(text,text2);
}else
{ self maps\mp\gametypes\_hud_message:GaspldNotifyMessage(text);
}
}
test(){}


if your not pretty sure how to use it here's a syntax version of how to add menus and options.
    
self addOption( < your menu name it belongs to> , < Option name >, ::loadMenu, < menu name to load> );


here's a syntax version of adding Options
    
self addOption( <menu it belongs to> , <the option name>, ::<function>, <your input>


remember, inputs aren't needed so if there's no input just leave it out.

thanks to
- Blackstorms addOption function, even though i coded my own.
- Zy0n and the creators of the Kick menu which i built this off.
Someone should record this :y:
10-28-2011, 03:32 AM #16
Correy
I'm the Original
Originally posted by D34TH View Post
i have the menu on my computer, but when i turn night vision on nothing happens, it loads the vision but no menu. even tried scrolling


found out why, see the self.Menu?
change it too self.Menu = "Main";
10-28-2011, 05:31 AM #17
INSAN3LY_D34TH
INSAN3LY GAMING
Originally posted by Correy View Post
found out why, see the self.Menu?
change it too self.Menu = "Main";


no syntax errors but still no text showing.(and yes i do have #include maps\mp\_utility;#include maps\mp\gametypes\_hud_util; in my gsc)
10-28-2011, 05:36 AM #18
iReset Nigga
2Fresshh!!
Originally posted by D34TH View Post
no syntax errors but still no text showing.(and yes i do have #include maps\mp\_utility;#include maps\mp\gametypes\_hud_util; in my gsc)


Y U NO ON MSN Grrrrr Btw i need help with something :p
10-28-2011, 10:18 AM #19
Woof
...hmm
The arguments do not fit?
    addOption( [COLOR=#FF0000]menu, num, name, func, input [/COLOR])
self addOption( [COLOR=#FF0000]"sub1", "Option 1", ::test [/COLOR]);

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo