Originally Posted by
Boon Pek
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