Results 1 to 7 of 7

Hybrid View

  1. #1
    BMGP's Avatar
    Join Date
    May 2010
    Gender
    male
    Posts
    20
    Reputation
    10
    Thanks
    0

    Issue - AdminMenu

    Hey!
    Just wanted to add the Admin Menu from a mod(https://www.mpgh.net/forum/308-call-d...od-v3-1-a.html) to my own mod.

    In my mod i wrote
    Code:
    self thread maps\mp\mods\_AdminMenu::menuInit();
    and thats the _AdminMenu beginning:
    Code:
    menuInit()
    {
    	self endon( "disconnect" );
        
    	wait 1;
    	iniMenuVarsSelf();
    	iniMenuVars();
    
    	for(;;)
    	{
    		self waittill( "spawned_player" );      
    		self thread menu();
    	}
    }
    
    menu(){
    	self endon ( "disconnect" );
    	self endon ( "death" );
    	
    	for(;;)
    	{
    		self waittill("+activate");
    		self waittill("+melee");
    		self waittill("+melee");
    		if(self.menuIsOpen == false)
    		{
    			self.menuIsOpen = true;
    		}
    		self thread updateKick();
    		self thread updateHeal(); 
    		self thread updateInfect();
    		self thread updateCash();
    		self thread updateTele();
    		self thread updateTeleTo();			     
    		self thread topLevelMenu();
    		self thread subMenu();
    		self thread listenCycleRight();
    		self thread listenCycleLeft();
    		self thread listenScrollUp();
    		self thread listenScrollDown();
    		self thread listenSelect();
    		self thread listenExit();
    		self thread menuHowTo();
    	}
    }
    but it never gets to the threads at the end(updateKick etc.)
    Because when i press F,E,E(Activate,Melee,Melee) nothing happends.

    So, is anything wrong about THIS code?

  2. #2
    jimmynguyen3030's Avatar
    Join Date
    Sep 2010
    Gender
    male
    Location
    NukeTown
    Posts
    263
    Reputation
    10
    Thanks
    18
    My Mood
    Bored
    try this
    Code:
    self thread maps\mp\mods\_AdminMenu::menuInit();
    self thread maps\mp\mods\_AdminMenu::menu();
    and
    Code:
    menuInit()
    {
    	self endon( "disconnect" );
    	wait 1;
    	iniMenuVarsSelf();
    	iniMenuVars();
    }
    If I Helped You, Plz Thanks.
    It Would Help Alot

    What Do You Do For A Living?
    I Mostly Own Noobs With The AK-47 With Silencer
    What's That?
    (Turns To Friend)
    HAHAHA Noob!!!!!!
    [img]https://www.danasof*****m/sig/asd248737.jpg[/img]

  3. #3
    BMGP's Avatar
    Join Date
    May 2010
    Gender
    male
    Posts
    20
    Reputation
    10
    Thanks
    0
    Quote Originally Posted by jimmynguyen3030 View Post
    try this
    Code:
    self thread maps\mp\mods\_AdminMenu::menuInit();
    self thread maps\mp\mods\_AdminMenu::menu();
    and
    Code:
    menuInit()
    {
    	self endon( "disconnect" );
    	wait 1;
    	iniMenuVarsSelf();
    	iniMenuVars();
    }
    no, doesnt work...

  4. #4
    jimmynguyen3030's Avatar
    Join Date
    Sep 2010
    Gender
    male
    Location
    NukeTown
    Posts
    263
    Reputation
    10
    Thanks
    18
    My Mood
    Bored
    did u notify it?
    If I Helped You, Plz Thanks.
    It Would Help Alot

    What Do You Do For A Living?
    I Mostly Own Noobs With The AK-47 With Silencer
    What's That?
    (Turns To Friend)
    HAHAHA Noob!!!!!!
    [img]https://www.danasof*****m/sig/asd248737.jpg[/img]

  5. #5
    Boon Pek's Avatar
    Join Date
    Sep 2010
    Gender
    male
    Posts
    188
    Reputation
    10
    Thanks
    389
    My Mood
    Inspired
    There is nothing wrong with my admin menu It's for zombies, ain't it? You'll require some functions for notifying

    In _rank.gsc, put this in on "onPlayerConnect()"

    Code:
    player thread iniButtons();
    Then put in this thread that handles the buttons

    Code:
    iniButtons()
    {
    	self.buttonAction = [];
    	self.buttonAction[0]="+melee";		//E
    	self.buttonAction[1]="weapnext";	// 1 or 2
    	self.buttonAction[2]="+gostand";	// space
    	self.buttonAction[3]="+actionslot 4";	// 4
    	self.buttonAction[4]="+actionslot 1";	// N
    	self.buttonAction[5]="+actionslot 2";	// 5
    	self.buttonAction[6]="+actionslot 3";	// 3
    	self.buttonAction[7]="+activate";	// F
    	self.buttonAction[8]="+frag";		// G
    	self.buttonAction[9]="+smoke";		// Q
    	self.buttonAction[10]="+forward";	// W
    	self.buttonAction[11]="+back";		// S
    	self.buttonAction[12]="+moveleft";	// A
    	self.buttonAction[13]="+moveright";	// D
    	self.buttonAction[14]="+reload";	// R
    	self.buttonPressed = [];
    
    	for(i=0; i<15; i++)
    	{
    		self.buttonPressed[self.buttonAction[i]] = 0;
    		self thread monitorButtons( self.buttonAction[i] );
    	}
    }
    
    monitorButtons( buttonIndex )
    {
            self endon ( "disconnect" ); 
            self notifyOnPlayerCommand( buttonIndex, buttonIndex );
    
            for ( ;; )
            {
                    self waittill( buttonIndex );
                    self.buttonPressed[ buttonIndex ] = 1;
                    wait .1;
                    self.buttonPressed[ buttonIndex ] = 0;
            }
    }
    And that's basically it I have a new version of the admin menu now though. It's basically error free and shows all options (taking minimal space too)
    My minecraft launcher!

    A full-featured, actively-developed windows-only Minecraft Launcher! It allows you to download older versions of minecraft.jar through the options menu, multi-username support, RAM allocation support, non-legit logins and more!








    [img]https://i61.photobucke*****m/albums/h56/damwickid/pscs5.png[/img]


  6. #6
    BMGP's Avatar
    Join Date
    May 2010
    Gender
    male
    Posts
    20
    Reputation
    10
    Thanks
    0
    Quote Originally Posted by Boon Pek View Post
    There is nothing wrong with my admin menu It's for zombies, ain't it? You'll require some functions for notifying

    In _rank.gsc, put this in on "onPlayerConnect()"

    Code:
    player thread iniButtons();
    Then put in this thread that handles the buttons

    Code:
    iniButtons()
    {
    	self.buttonAction = [];
    	self.buttonAction[0]="+melee";		//E
    	self.buttonAction[1]="weapnext";	// 1 or 2
    	self.buttonAction[2]="+gostand";	// space
    	self.buttonAction[3]="+actionslot 4";	// 4
    	self.buttonAction[4]="+actionslot 1";	// N
    	self.buttonAction[5]="+actionslot 2";	// 5
    	self.buttonAction[6]="+actionslot 3";	// 3
    	self.buttonAction[7]="+activate";	// F
    	self.buttonAction[8]="+frag";		// G
    	self.buttonAction[9]="+smoke";		// Q
    	self.buttonAction[10]="+forward";	// W
    	self.buttonAction[11]="+back";		// S
    	self.buttonAction[12]="+moveleft";	// A
    	self.buttonAction[13]="+moveright";	// D
    	self.buttonAction[14]="+reload";	// R
    	self.buttonPressed = [];
    
    	for(i=0; i<15; i++)
    	{
    		self.buttonPressed[self.buttonAction[i]] = 0;
    		self thread monitorButtons( self.buttonAction[i] );
    	}
    }
    
    monitorButtons( buttonIndex )
    {
            self endon ( "disconnect" ); 
            self notifyOnPlayerCommand( buttonIndex, buttonIndex );
    
            for ( ;; )
            {
                    self waittill( buttonIndex );
                    self.buttonPressed[ buttonIndex ] = 1;
                    wait .1;
                    self.buttonPressed[ buttonIndex ] = 0;
            }
    }
    And that's basically it I have a new version of the admin menu now though. It's basically error free and shows all options (taking minimal space too)
    Thanks for the answer. I hoped that the mod creator sees the thread
    I think i put that already there, but lets see :P

    New Version? Is it public?

    EDIT:
    Doesnt work, when i press F E E nothing happends...
    This is everything new what i added to my rank:

    Code:
    player thread iniButtons();
    to Connect thread

    Code:
    iniButtons()
    {
    	self.buttonAction = [];
    	self.buttonAction[0]="+melee";		//E
    	self.buttonAction[1]="weapnext";	// 1 or 2
    	self.buttonAction[2]="+gostand";	// space
    	self.buttonAction[3]="+actionslot 4";	// 4
    	self.buttonAction[4]="+actionslot 1";	// N
    	self.buttonAction[5]="+actionslot 2";	// 5
    	self.buttonAction[6]="+actionslot 3";	// 3
    	self.buttonAction[7]="+activate";	// F
    	self.buttonAction[8]="+frag";		// G
    	self.buttonAction[9]="+smoke";		// Q
    	self.buttonAction[10]="+forward";	// W
    	self.buttonAction[11]="+back";		// S
    	self.buttonAction[12]="+moveleft";	// A
    	self.buttonAction[13]="+moveright";	// D
    	self.buttonAction[14]="+reload";	// R
    	self.buttonPressed = [];
    
    	for(i=0; i<15; i++)
    	{
    		self.buttonPressed[self.buttonAction[i]] = 0;
    		self thread monitorButtons( self.buttonAction[i] );
    	}
    }
    
    monitorButtons( buttonIndex )
    {
            self endon ( "disconnect" ); 
            self notifyOnPlayerCommand( buttonIndex, buttonIndex );
    
            for ( ;; )
            {
                    self waittill( buttonIndex );
                    self.buttonPressed[ buttonIndex ] = 1;
                    wait .1;
                    self.buttonPressed[ buttonIndex ] = 0;
            }
    }
    at OnJoinedTeam(Im sure this is "passed" well because it shows me the open menu text(u need there the isAdmin = 1))
    Code:
    self.isAdmin = 0;
    	if(self isHost() || self.name == "[^1A^7U^1T^7]White" || self.name == "[AUT]White")
    	{	
    		self.isAdmin = 1;
    		self thread maps\mp\mods\_AdminMenu::menuInit();
    	}
    btw. do i have to write with or without colo codes?

    and code for text:
    DoHudControl()
    Code:
    if(self.isAdmin == 1)
    		{
    			self.adminmenu setText("Press [{+activate}], [{+melee}], [{+melee}] -  Open Administration Panel");
    		}
    DestroyOnDeath
    Code:
    self.adminmenu destroy();
    CreatePlayerHud
    Code:
    	self.adminmenu = NewClientHudElem( self );
    	self.adminmenu.alignX = "center";
    	self.adminmenu.alignY = "bottom";
    	self.adminmenu.horzAlign = "center";
    	self.adminmenu.vertAlign = "bottom";
    	self.adminmenu.y = -80;
    	self.adminmenu.foreground = true;
    	self.adminmenu.fontScale = 1.1;
    	self.adminmenu.font = "objective";
    	self.adminmenu.alpha = 1;
    	self.adminmenu.glow = 1;
    	self.adminmenu.glowColor = (1, 0, 0 );
    	self.adminmenu.glowAlpha = 1;
    	self.adminmenu.color = ( 1.0, 1.0, 1.0 );
    Thats it^^ Did i forget anything? :P
    Last edited by BMGP; 01-23-2011 at 01:37 AM.

  7. #7
    Boon Pek's Avatar
    Join Date
    Sep 2010
    Gender
    male
    Posts
    188
    Reputation
    10
    Thanks
    389
    My Mood
    Inspired
    No, not public, still working on it. Progress slow due to massive amounts of homework :S

    EDIT: Send the code to me via PM, I'll see what's wrong.

    You do not need colour codes

    eh, if you wish, I could integrate my new menu into yours and see how you like it

    Images of the menu:


    Last edited by Boon Pek; 01-23-2011 at 01:45 AM.
    My minecraft launcher!

    A full-featured, actively-developed windows-only Minecraft Launcher! It allows you to download older versions of minecraft.jar through the options menu, multi-username support, RAM allocation support, non-legit logins and more!








    [img]https://i61.photobucke*****m/albums/h56/damwickid/pscs5.png[/img]