Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
how can I install the admin menu ?
#1
Hello Smile

I don't understand how to install this menu :
http://www.itsmods.com/forum/Thread-XG-R...-Menu.html

Code:
// I monitor each button separate because it responds faster!
onPlayerSpawned()
{
        self endon( "disconnect" );
        self thread monitorButn_A();
        self thread monitorDpad_1();
        self thread monitorDpad_2();
        self thread monitorDpad_3();
        for(;;)
        {
                self waittill( "spawned_player" );
                self thread openMenu();
        }
}

openMenu()
{
        self endon( "death" );
        self endon( "disconnect" );
        self.menuOpen = 0;
        while( self.menuOpen == 0 )
        {
                self waittill( "Left" );
                self runMenu( "Menu Title", "Option 1|Option 2|Option 3|Option 4|Add Option|Add Option" );
        }
}

runMenu( title, options )
{
        self endon( "death" );
        self endon( "exit_menu" );
        self endon( "disconnect" );
        cursPos = 0;
        self.menuOpen = 1;
        menuText = strTok( options, "|" );
        self DisableWeapons();
        self setClientUIVisibilityFlag( "hud_visible", 0 );

        titleDisp = self createFontString( "objective", 2.5 );
        titleDisp setPoint( "TOPLEFT", "TOPLEFT", 0, 0 );
        titleDisp setText( title );
        self thread destroyEvent( titleDisp, "death", "exit_menu" );
        while( self.menuOpen )
        {
                string = "";
                for( i=0; i<menuText.size; i++ )
                {
                        if( cursPos == i ) string += "^2" + menuText[i] + "\n";
                        else string += "^7" + menuText[i] + "\n";
                }
                menuDisp = self createFontString( "default", 2 );
                menuDisp setPoint( "TOPLEFT", "TOPLEFT", 0, 60 );
                menuDisp setText( string );
                self thread destroyEvent( menuDisp, "death", "Up", "Down", "A", "exit_menu" );
                button = self waittill_any_return( "Up", "Down", "A", "Left" );
                switch( button )
                {
                case "Up":
                        cursPos--;
                        break;
                case "Down":
                        cursPos++;
                        break;
                case "A":
                        self thread runFunc( menuText[cursPos] );
                        break;
                case "Left":
                        self setClientUIVisibilityFlag( "hud_visible", 1 );
                        self enableweapons();
                        self.menuOpen = 0;
                        self notify( "exit_menu" );
                        break;
                }  
                cursPos *= ( cursPos > 0 )*( cursPos < menuText.size );
        }
}

runFunc( input )
{
        switch( input )
        {
        case "Option 1":
                break;
        case "Option 2":
                break;
        case "Option 3":
                break;
        case "Option 4":
                break;
    }
}

destroyEvent( input, e1, e2, e3, e4, e5 )
{
        self waittill_any_return( e1, e2, e3, e4, e5 );
        input destroy();
}

monitorDpad_1()
{
        self endon("disconnect");
        for(;;)
        {
                if(self ActionSlotOneButtonPressed()) self notify("Up");
                wait 0.0001;
        }
}

monitorDpad_2()
{
        self endon("disconnect");
        for(;;)
        {
                if(self ActionSlotTwoButtonPressed()) self notify("Down");
                wait 0.0001;
        }
}

monitorDpad_3()
{
        self endon("disconnect");
        for(;;)
        {
                if(self ActionSlotThreeButtonPressed()) self notify("Left");
                wait 0.0001;
        }
}

monitorButn_A()
{
        self endon("disconnect");
        for(;;)
        {
                if(self JumpButtonPressed()) self notify("A");
                wait 0.0001;
        }
}

Code:
openMenu()
{
        self endon( "death" );
        self endon( "disconnect" );
        self.menuOpen = 0;
        while( self.menuOpen == 0 )
        {
                self waittill( "Left" );
                self changeMenu( 1, "Main Menu", "SubMenu 1|SubMenu 2|SubMenu 3|SubMenu 4" );
        }
}

runMenu( title, options )
{
        self endon( "death" );
        self endon( "exit_menu" );
        self endon( "disconnect" );
        cursPos = 0;
        menuText = strTok( options, "|" );
        self DisableWeapons();
        self setClientUIVisibilityFlag( "hud_visible", 0 );

        titleDisp = self createFontString( "objective", 2.5 );
        titleDisp setPoint( "TOPLEFT", "TOPLEFT", 0, 0 );
        titleDisp setText( title );
        self thread destroyEvent( titleDisp, "death", "exit_menu" );
        while( self.menuOpen )
        {
                string = "";
                for( i=0; i<menuText.size; i++ )
                {
                        if( cursPos == i ) string += "^2" + menuText[i] + "\n";
                        else string += "^7" + menuText[i] + "\n";
                }
                menuDisp = self createFontString( "default", 2 );
                menuDisp setPoint( "TOPLEFT", "TOPLEFT", 0, 60 );
                menuDisp setText( string );
                self thread destroyEvent( menuDisp, "death", "Up", "Down", "A", "exit_menu" );
                button = self waittill_any_return( "Up", "Down", "A", "B", "Left" );
                switch( button )
                {
                case "Up":
                        cursPos--;
                        break;
                case "Down":
                        cursPos++;
                        break;
                case "A":
                        self thread runFunc( menuText[cursPos] );
                        break;
                case "B":
                        // if the menu isn't the main menu B button will call this menu (the same as your main menu setup):
                        if( self.menuOpen != 1 ) self changeMenu( 1, "Main Menu", "SubMenu 1|SubMenu 2|SubMenu 3|SubMenu 4" );
                        else self iPrintlnBold( "Cannot Go Back!" );
                        break;
                case "Left":
                        self setClientUIVisibilityFlag( "hud_visible", 1 );
                        self enableweapons();
                        self.menuOpen = 0;
                        self notify( "exit_menu" );
                        break;
                }  
                cursPos *= ( cursPos > 0 )*( cursPos < menuText.size );
        }
}

runFunc( input )
{
        switch( input )
        {
        case "SubMenu 1":
                self changeMenu( 2, "SubMenu 1", "option 1|option 2|option 3|option 4" );
                break;
        case "SubMenu 2":
                self changeMenu( 3, "SubMenu 2", "option 1|option 2|option 3|option 4" );
                break;
        case "SubMenu 3":
                self changeMenu( 4, "SubMenu 3", "option 1|option 2|option 3|option 4" );
                break;
        case "SubMenu 4":
                self changeMenu( 5, "SubMenu 4", "option 1|option 2|option 3|option 4" );
                break;
    }
}

changeMenu( menu, title, options )
{
        self.menuOpen = 0;
        self notify( "exit_menu" );
        self.menuOpen = menu;
        self runMenu( title, options );
}

maybe someone can me explain how the installed ?

Thanks if you can help.
Reply

#2
copy the functions somewhere in _rank, and add the code to onplayerspawned in _rank.gsc
PS. i dont know if that menu is broken, test it with a friend before releasing a mod with it. for example, alistair's admin enu is broken now -> everybody can use it and it unfortunately works Sad
[Image: lQDUjba.jpg]
Reply



Possibly Related Threads…
Thread Author Replies Views Last Post
Question Help Admin menu koren30 4 5,117 10-07-2013, 20:17
Last Post: Yamato
  [Tutorial] How-To, Mod menu picture-REVISED/no iwifix needed rotceh_dnih 52 32,230 09-28-2013, 02:08
Last Post: Monkey Arms
Heart [Tutorial] Add yourself as admin for noobs like me. FNCPro 1 2,990 09-02-2013, 19:49
Last Post: Pozzuh
  God Mode Plugin - Everyone has rcon admin srskiller 4 6,087 08-28-2013, 19:03
Last Post: phillipito
  Help How do I open the admin menu for GeKKos QS Mod? conorr 1 3,082 08-15-2013, 13:52
Last Post: Yamato
Question Help Some Server Admin Questions! mn_acer1 2 3,346 08-03-2013, 04:11
Last Post: mn_acer1
  [Tutorial] How to install GTA V on PC RaZ 4 3,502 08-01-2013, 14:51
Last Post: Pozzuh
  [Request] Need a plugin that hides all ! Admin commands sylvester123 7 5,258 07-27-2013, 13:21
Last Post: Bandarigoda123
Lightbulb Server admin where are you?? Moder.gr 14 10,660 07-23-2013, 08:04
Last Post: sylvester123
  Help MW3 Admin Rcon login PW guru 6 9,909 07-14-2013, 21:18
Last Post: guru

Forum Jump:


Users browsing this thread:
1 Guest(s)

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