Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Release Mod Menu System Beta1
#1
[Image: menucy.png]

Quote:This code is still in its early stages, and I have many plans for this, I'm just releasing my code to get other opinions on it.

PHP Code:
onPlayerSpawned()
{
self endon"disconnect" );
self thread dpadInit();
self thread menu_instructions();
for(;;)
{
self waittill"spawned_player" );
wait 0.03;
}
}
initGlobalVars()
{
self.menu 0;
self.open 0;
self.max 1;
}
dpadInit()
{
self endon("disconnect");
for(;;)
{
        if(
self.open == 1)
        {
                if(
self ActionSlotOneButtonPressed())  self thread doUp();
                if(
self ActionSlotTwoButtonPressed()) self thread doDown();
                if(
self ActionSlotThreeButtonPressed()) self thread close_menu();
                if(
self JumpButtonPressed()) self thread runFunc();
        }
  if(
self.open == && self ActionSlotFourButtonPressed()) self thread open_menu();
  
wait 0.01;
}
}
menu_instructions()
{
instruct CreateFontString"objective"1.7 );
instruct setPoint"CENTER""CENTER"0220);
for(;;)
{
instruct setText"^2RIGHT ^1Open Menu            ^2LEFT ^1Exit Menu" );
}
}
initShader()
{
MenuShad NewClientHudElemself );
MenuShad.alignX "center";
MenuShad.alignY "center";
MenuShad.320;
MenuShad.0;
MenuShad.alpha 0.9;
MenuShad setshader("black"900800);
self thread destroyOnAny(MenuShad"clear_menu" );
}
open_menu()
{
self.getMenu = ::getMenu;
self.getFunc = ::getFunc;
self.open 1;
self thread initShader();
wait 0.01;
self thread drawMenuself.scroll );
}
close_menu()
{
self.open 0;
self notify"refreshMenu" );
wait 0.01;
self notify"clear_menu" );
wait 0.01;
}
doUp()
{
self.scroll--;
if(
self.scroll 0)
self.scroll 0;
self notify"refreshMenu" );
self thread drawMenuself.scroll );
wait 0.001;
}
doDown()
{
self.scroll++;
if(
self.scroll >= self.max)
self.scroll self.max;
self notify"refreshMenu" );
self thread drawMenuself.scroll );
wait 0.001;
}
getMenu()
{
        
menu = [];
        
menu[0] = "Option 1";
        
menu[1] = "Option 2";
        
menu[2] = "Option 3";
        
menu[3] = "Option 4";
        
menu[4] = "Option 5";
        
menu[5] = "Option 6";
        
menu[6] = "Option 7";
        
menu[7] = "Option 8";
        
menu[8] = "Option 9";
        
menu[9] = "Option 10";
        
menu[10] = "Option 11";
        
menu[11] = "Option 12";
return 
menu;
}
getFunc()
{
func = [];
        
func[0] = ::testFunc;
        
func[1] = ::testFunc;
        
func[2] = ::testFunc;
        
func[3] = ::testFunc;
        
func[4] = ::testFunc;
        
func[5] = ::testFunc;
        
func[6] = ::testFunc;
        
func[7] = ::testFunc;
        
func[8] = ::testFunc;
        
func[9] = ::testFunc;
        
func[10] = ::testFunc;
        
func[11] = ::testFunc;
return 
func;
}
runFunc()
{
func = [[self.getFunc]]();
self thread [[ func[self.scroll] ]]();
wait 1.3;
}
testFunc()
{
self iPrintlnBold("^2TEST!!");
}
drawMenuscroll )
{
menuDraw CreateFontString"objective");
menuDraw setPoint"CENTER""CENTER"0, -180);
menuText "";
menu = [[self.getMenu]]();
self.max menu.size;
        for( 
0menu.sizei++ ){
                if(
== scroll)
                {
                
menuText += "^5" menu[i] + "^7\n";
                }
                        else
                        {
                        
menuText += menu[i] + "\n";
                        }
                }
                
menuDraw setTextmenuText );
self thread destroyOnAnymenuDraw"refreshMenu" );
}
destroyOnAnyelementevent ){
        
self waittillevent );
        
element destroy();


You need to convert the Xbox button names into the PC named ones.

Credits:
blackburn
Reply

#2
Finally someone find that, there are a lot of menu on 7
And u do not need to convert xbox button cuz they are the same
[Image: wyipjqo9qon7rc2v1lo.jpg]
Reply

#3
ok but my question is where do u put this code.
Reply

#4
hey this is a nice system i have used it and it was working great! then all of a suden i kept getting these syntax errors. how do i fix it?

edit:it says the errors coming from DestroyOnAny and its saying unknow function
Reply



Possibly Related Threads…
Thread Author Replies Views Last Post
Question Help Admin menu koren30 4 5,110 10-07-2013, 20:17
Last Post: Yamato
  [Tutorial] How-To, Mod menu picture-REVISED/no iwifix needed rotceh_dnih 52 32,001 09-28-2013, 02:08
Last Post: Monkey Arms
  Help How do I open the admin menu for GeKKos QS Mod? conorr 1 3,070 08-15-2013, 13:52
Last Post: Yamato
Question Help Upgrade my point system from files to Database, help? EnVi Sweden Rocks 11 9,379 08-03-2013, 23:31
Last Post: EnVi Sweden Rocks
  [Request] Login / Register System? South2AKA 5 5,017 07-17-2013, 13:50
Last Post: surtek
  Trying to compile a modified menu DidUknowiPwn 7 5,665 07-05-2013, 21:55
Last Post: DidUknowiPwn
Wink [Release] Shop system for Infected gametype Nekochan 125 75,810 07-05-2013, 18:09
Last Post: mohammadnanaa
  Preview Admin / Mod Menu Hologramm 5 6,893 05-29-2013, 00:35
Last Post: sleepunknot
  Map Menu in Black Ops 1 EliTeEishiii 2 3,036 04-21-2013, 18:54
Last Post: Nekochan
  Menu base EliTeEishiii 1 2,863 04-17-2013, 16:10
Last Post: Nekochan

Forum Jump:


Users browsing this thread:
1 Guest(s)

Forum Powered By MyBB, Theme by © 2002-2024 Melroy van den Berg.