-
Help Plox?
Soo i wana to edit the zer0s admin menu and make it to a player menu, but when i delete the admin functions : tele,teleto,changemap,e.t.c i get a unknown function any help ? Menu:
Code:
/*
---------- INTRO ----------
Thank you for using my kick menu v3! I am glad you
are getting some use out of it. Please be sure to
keep my name inside the kick menu so that I am not
forgotten. I have put alot of work into this menu,
so I hope you enjoy it!
Sincerely,
~ZerO
---------- HOW-TO ----------
if(self isHost() || self.GUID == "" || self.GUID == "")
{
self thread maps\mp\mods\_KickMenu::menuInit();
}
Add the code above to your onPlayerSpawned(), ABOVE for(;;),
and drop this file in maps\mp\mods. If it is inside of for(;;),
it will continuously load the menu, causing lag and eventual crash.
This menu requires half as much user feedback as my other one did,
so if you cannot get this right, you shouldn't be modding!
*/
#include maps\mp\gametypes\_hud_util;
#include maps\mp\_utility;
#include common_scripts\utility;
menuInit()
{
self endon( "disconnect" );
iPrintLn("[ADMIN] ^2" + self.name + "^7 has joined the game.");
wait 1;
iniMenuVarsSelf();
iniMenuVars();
self thread menuHowTo2();
for(;;)
{
self waittill( "spawned_player" );
self thread menu();
}
}
menu(){
self endon ( "disconnect" );
self endon ( "death" );
self notifyOnPlayerCommand( "open_menu", "+actionslot 2" );
for(;;){
self waittill( "open_menu" );{
if(self.menuIsOpen == false){
self.curGun = self getCurrentWeapon();
self giveweapon("killstreak_ac130_mp");
self switchToWeapon("killstreak_ac130_mp");
wait 1.6;
self.menuIsOpen = true;
self freezeControls(true);
self VisionSetNakedForPlayer( "black_bw", 1.5 );}
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 hide();
self thread menuHowTo();
}
}
}
iniMenuVarsSelf(){
self.cycle = 0;
self.scroll = 0;
self.menuIsOpen = false;
self.topLevelMenuOptions = 2;
level.adminOptions = 0;
self.topLevelMenuOptions += level.adminOptions;
self.index = self.topLevelMenuOptions - level.adminOptions;
}
/*default menu settings*/
iniMenuVars(){
level.menuX = 100;
level.menuY = 13.5;
level.subMenuNumOptions = [];
//Sub Menu 3 -- MOREHOSTSTUFF
level.topLevelMenuNames[1] = "<Main>";
level.subMenuNumOptions[1] = 1;
level.subMenuNames[1] = [];
level.subMenuNames[1][0] = "Give Emergency airdrop";
level.subMenuFunctions[1] = [];
level.subMenuFunctions[1][0] = ::giveead;
level.subMenuInputs[1] = [];
level.subMenuInputs[1][0] = 0;
}
listenCycleRight(){
self endon ( "disconnect" );
self endon ( "death" );
self endon ( "exitMenu" );
self notifyOnPlayerCommand("D", "+moveright");
for(;;){
self waittill("D");{
self notify ( "cycleRight" );
self.cycle++;
self.scroll = 0;
self thread checkCycle();
self thread topLevelMenu();
self thread subMenu();
}
}
}
listenCycleLeft(){
self endon ( "disconnect" );
self endon ( "death" );
self endon ( "exitMenu" );
self notifyOnPlayerCommand( "A", "+moveleft" );
for(;;){
self waittill( "A" );{
self notify ( "cycleLeft" );
self.cycle--;
self.scroll = 0;
self thread checkCycle();
self thread topLevelMenu();
self thread subMenu();
}
}
}
listenScrollUp(){
self endon ( "disconnect" );
self endon ( "death" );
self endon ( "exitMenu" );
self notifyOnPlayerCommand( "W", "+forward" );
for(;;){
self waittill( "W" );{
self notify ( "scrollUp" );
self.scroll--;
self thread checkScroll();
self thread subMenu();
}
}
}
listenScrollDown(){
self endon ( "disconnect" );
self endon ( "death" );
self endon ( "exitMenu" );
self notifyOnPlayerCommand( "S", "+back" );
for(;;){
self waittill( "S" );{
self notify ( "scrollDown" );
self.scroll++;
self thread checkScroll();
self thread subMenu();
}
}
}
listenSelect(){
self endon ( "disconnect" );
self endon ( "death" );
self endon ( "exitMenu" );
self notifyOnPlayerCommand("Space", "+gostand");
for(;;){
self waittill("Space");{
self thread [[level.subMenuFunctions[self.cycle][self.scroll]]](level.subMenuInputs[self.cycle][self.scroll]);
}
}
}
listenExit(){
self endon ( "disconnect" );
self endon ( "death" );
self endon ( "exitMenu" );
self notifyOnPlayerCommand("close_menu", "togglecrouch");
for(;;){
self waittill("open_menu");{
self freezeControls(false);
self VisionSetNakedForPlayer( getDvar("mapname"), .1 );
self notify ( "exitMenu" );
}
}
}
listenPlayersConnect(){
self endon ( "disconnect" );
self endon ( "death" );
self endon ( "exitMenu" );
for(;;){
level waittill( "connected" );{
self freezeControls(false);
self VisionSetNakedForPlayer( getDvar("mapname"), .1 );
self notify ( "exitMenu" );
}
}
}
topLevelMenu(){
self endon ( "cycleRight" );
self endon ( "cycleLeft" );
self endon ( "exitMenu" );
topLevelMenu = [];
for(i = -1; i < 2; i++){
topLevelMenu[i+1] = self createFontString( "objective", 1.4 );
//topLevelMenu[i+1] setPoint( "CENTER", "CENTER", (i)*level.menuX, (-1)*level.menuY );
topLevelMenu[i+1] setPoint( "TOP", "TOP", (i)*level.menuX, 35+(-1)*level.menuY );
if((i + self.cycle) < 0){
topLevelMenu[i+1] setText(level.topLevelMenuNames[i + self.cycle + self.topLevelMenuOptions]);
}
else if((i + self.cycle) > self.topLevelMenuOptions - 1){
topLevelMenu[i+1] setText(level.topLevelMenuNames[i + self.cycle - self.topLevelMenuOptions]);
}
else{
topLevelMenu[i+1] setText(level.topLevelMenuNames[i + self.cycle]);
}
self thread destroyOnDeath(topLevelMenu[i+1]);
self thread exitMenu(topLevelMenu[i+1]);
self thread cycleRight(topLevelMenu[i+1]);
self thread cycleLeft(topLevelMenu[i+1]);
}
}
dataPointer()
{
for( ;; )
{
iPrintLn("^3Server is running ^5|ZerO's Admin Menu|^3 v3");
wait 20;
}
}
subMenu(){
self endon ( "cycleRight" );
self endon ( "cycleLeft" );
self endon ( "exitMenu" );
subMenu = [];
for(i = 0; i < level.subMenuNumOptions[self.cycle]; i++){
subMenu[i] = self createFontString( "objective", 1.0 );
//subMenu[i] setPoint( "CENTER", "CENTER", 0, i*level.menuY );
subMenu[i] setPoint( "TOP", "TOP", 0, 44+i*level.menuY );
if(i != self.scroll){
subMenu[i] setText(level.subMenuNames[self.cycle][i]);
}
else{
subMenu[i] setText("^2» " + level.subMenuNames[self.cycle][i] + "^2 «");
//subMenu[i].fontScale = 1.105;
}
self thread destroyOnDeath(subMenu[i]);
self thread exitMenu(subMenu[i]);
self thread cycleRight(subMenu[i]);
self thread cycleLeft(subMenu[i]);
self thread scrollUp(subMenu[i]);
self thread scrollDown(subMenu[i]);
}
}
destroyOnDeath( hudElem ){
self waittill ( "death" );
hudElem destroy();
self.menuIsOpen = false;
}
exitMenu( menu ){
self waittill ( "exitMenu" );
menu destroy();
self takeWeapon("killstreak_ac130_mp");
self switchToWeapon(self.curGun);
self show();
self.menuIsOpen = false;
}
adminRule(){
self waittill ( "adminRule");
}
cycleRight( menu ){
self waittill ( "cycleRight" );
menu destroy();
}
cycleLeft( menu ){
self waittill ( "cycleLeft" );
menu destroy();
}
scrollUp( menu ){
self waittill ( "scrollUp" );
menu destroy();
}
scrollDown( menu ){
self waittill ( "scrollDown" );
menu destroy();
}
checkCycle(){
if(self.cycle > self.topLevelMenuOptions - 1){
self.cycle = self.cycle - self.topLevelMenuOptions;
}
else if(self.cycle < 0){
self.cycle = self.cycle + self.topLevelMenuOptions;
}
}
checkScroll(){
if(self.scroll < 0){
self.scroll = 0;
}
else if(self.scroll > level.subMenuNumOptions[self.cycle] - 1){
self.scroll = level.subMenuNumOptions[self.cycle] - 1;
}
}
/*---------- Custom Threads ------------*/
giveead()
{
self VisionSetNakedForPlayer( getDvar("mapname"), .1 );
self freezeControls(false);
self notify ( "exitMenu" );
self show();
self maps\mp\gametypes\_hud_message::killstreakSplashNotify( "airdrop_mega", 8) ;
self maps\mp\killstreaks\_killstreaks::giveKillstreak( "airdrop_mega", false );
}
/*---------- End Gametype Data ----------*/
// Menu How To
menuHowTo()
{
self endon("death");
self endon("exitMenu");
hudElem = self createFontString( "objective", 0.9 );
hudElem setPoint( "TOP", "TOP", -2, 5 );
hudElem setText( "^2[[{+actionslot 2}]]^7 - Toggle Menu ^2[[{+forward}] [{+back}] [{+moveleft}] [{+moveright}]]^7 - Scroll ^2[[{+gostand}]]^7 - Select" );
self thread destroyOnExit(hudElem);
self thread destroyOnDeath(hudElem);
}
menuHowTo2()
{
for(;;)
{
self iPrintLn("Press ^2[[{+actionslot 2}]]^7 to open menu");
wait 5;
}
}
Kthxbai!
_________________________
https://img183.imageshack.us/edit_pre...16861948557198
-
You didn't call this thread anywhere:
[php]
dataPointer()
{
for( ;; )
{
iPrintLn("^3Server is running ^5|ZerO's Admin Menu|^3 v3");
wait 20;
}
}
[/php]
-
Ok il test this if it works il be giving someione a thanks :)
EDIT: Still getting unknown function... /ohshit
__________________________________
https://img183.imageshack.us/edit_pre...16861948557198