Issue - AdminMenu

Posts 1–7 of 7 · Page 1 of 1
Issue - AdminMenu
Hey!
Just wanted to add the Admin Menu from a mod(http://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?
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();
}
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...
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)
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
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:


Posts 1–7 of 7 · Page 1 of 1
This thread is closed for replies.

Tags for this Thread

None

Talk with us