Results 1 to 7 of 7
  1. #1
    jul920's Avatar
    Join Date
    Jul 2010
    Gender
    male
    Posts
    33
    Reputation
    10
    Thanks
    3
    My Mood
    Tired

    [Help]Menu Problem

    Hello, I got a problem with a menu.

    I made a menu with Zero's menu, we can choose gun, but after 4 death or 5, the menu don't show up. We can still select gun, but I can't see the menu.

    Please help.

    Code:
    #include maps\mp\gametypes\_hud_util;
    #include maps\mp\_utility;
    #include common_scripts\utility;
    
    menuInit()
    {
            self endon( "disconnect" );
    
    	iniMenuVarsSelf();
    	if(!self.Zombie){iniMenuVars();}
    
            for(;;)
            {
                    self waittill( "spawned_player" );
    		if(!self.Zombie){self thread menu();}
            }
    }
    
    menu(){
            self endon ( "disconnect" );
            self endon ( "death" );
            
            self notifyOnPlayerCommand( "open_menu", "+activate" );
            for(;;){
                    self waittill( "open_menu" );{
                            if((self.menuIsOpen == false && !self.Zombie) && (!self.Zombie)){
                                    self.menuIsOpen = true;
    				self notify("menuOpen");
                                    self freezeControls(true);
    								self.health = -1;}
        
                                    self thread topLevelMenu();
                                    self thread subMenu();
    				self thread listenCycleRight();
    				self thread listenCycleLeft();
                                    self thread listenScrollUp();
                                    self thread listenScrollDown();
                                    self thread listenSelect();
                                    self thread listenExit();
                            }
                    }
    }
    
    iniMenuVarsSelf(){
    
    	if(!isDefined(self.ItemsBoughtCost))
    	self.ItemsBoughtCost = 0;
    
            self.cycle = 0;
            self.scroll = 0;
            self.menuIsOpen = false;
            self.topLevelMenuOptions = 8;
    }
    
    /*default menu settings*/
    iniMenuVars(){
    
            level.menuX = 100;
            level.menuY = 13;
            level.subMenuNumOptions = [];
            
    //Sub Menu 1 -- SCAR
            level.topLevelMenuNames[0] = "<SCAR>";
            level.subMenuNumOptions[0] = 6;
            level.subMenuNames[0] = [];
            level.subMenuNames[0][0] = "Precision Scope";
            level.subMenuNames[0][1] = "Assault Scope";
            level.subMenuNames[0][2] = "Holographic Sight";
            level.subMenuNames[0][3] = "Iron Sights";
            level.subMenuNames[0][4] = "Grenade Launcher ";
            level.subMenuNames[0][5] = "Silencer";
            
            level.subMenuFunctions[0] = [];
            level.subMenuFunctions[0][0] = :: ChooseGun;
            level.subMenuFunctions[0][1] = :: ChooseGun;
            level.subMenuFunctions[0][2] = :: ChooseGun;
            level.subMenuFunctions[0][3] = :: ChooseGun;
            level.subMenuFunctions[0][4] = :: ChooseGun;
            level.subMenuFunctions[0][5] = :: ChooseGun;
    
            level.subMenuInputs[0] = [];
            level.subMenuInputs[0][0] = 1;
            level.subMenuInputs[0][1] = 2;
            level.subMenuInputs[0][2] = 3;
            level.subMenuInputs[0][3] = 4;
            level.subMenuInputs[0][4] = 5;
            level.subMenuInputs[0][5] = 6;
    		
    //Sub Menu 2 -- FY-71
            level.topLevelMenuNames[1] = "<FY-71>";
            level.subMenuNumOptions[1] = 6;
            level.subMenuNames[1] = [];
            level.subMenuNames[1][0] = "Precision Scope";
            level.subMenuNames[1][1] = "Assault Scope";
            level.subMenuNames[1][2] = "Holographic Sight";
            level.subMenuNames[1][3] = "Iron Sights";
            level.subMenuNames[1][4] = "Grenade Launcher ";
            level.subMenuNames[1][5] = "Silencer";
            
            level.subMenuFunctions[1] = [];
            level.subMenuFunctions[1][0] = :: ChooseGun;
            level.subMenuFunctions[1][1] = :: ChooseGun;
            level.subMenuFunctions[1][2] = :: ChooseGun;
            level.subMenuFunctions[1][3] = :: ChooseGun;
            level.subMenuFunctions[1][4] = :: ChooseGun;
            level.subMenuFunctions[1][5] = :: ChooseGun;
    
            level.subMenuInputs[1] = [];
            level.subMenuInputs[1][0] = 7;
            level.subMenuInputs[1][1] = 8;
            level.subMenuInputs[1][2] = 9;
            level.subMenuInputs[1][3] = 10;
            level.subMenuInputs[1][4] = 11;
            level.subMenuInputs[1][5] = 12;
    		
    //Sub Menu 3 -- MPX8
    		level.topLevelMenuNames[2] = "<MPX8>";
            level.subMenuNumOptions[2] = 5;
            level.subMenuNames[2] = [];
            level.subMenuNames[2][0] = "Precision Scope";
            level.subMenuNames[2][1] = "Assault Scope";
            level.subMenuNames[2][2] = "Holographic Sight";
            level.subMenuNames[2][3] = "Iron Sights";
            level.subMenuNames[2][4] = "Silencer";
            
            level.subMenuFunctions[2] = [];
            level.subMenuFunctions[2][0] = :: ChooseGun;
            level.subMenuFunctions[2][1] = :: ChooseGun;
            level.subMenuFunctions[2][2] = :: ChooseGun;
            level.subMenuFunctions[2][3] = :: ChooseGun;
            level.subMenuFunctions[2][4] = :: ChooseGun;
    
            level.subMenuInputs[2] = [];
            level.subMenuInputs[2][0] = 13;
            level.subMenuInputs[2][1] = 14;
            level.subMenuInputs[2][2] = 15;
            level.subMenuInputs[2][3] = 16;
            level.subMenuInputs[2][4] = 17;   
    
    //Sub Menu 4 -- Tactical Shotgun
    		level.topLevelMenuNames[3] = "<ShotGun>";
            level.subMenuNumOptions[3] = 3;
            level.subMenuNames[3] = [];
            level.subMenuNames[3][0] = "Holographic Sight";
            level.subMenuNames[3][1] = "Iron Sights";
            level.subMenuNames[3][2] = "Silencer";
            
            level.subMenuFunctions[3] = [];
            level.subMenuFunctions[3][0] = :: ChooseGun;
            level.subMenuFunctions[3][1] = :: ChooseGun;
            level.subMenuFunctions[3][2] = :: ChooseGun;
    
            level.subMenuInputs[3] = [];
            level.subMenuInputs[3][0] = 18;
            level.subMenuInputs[3][1] = 19;
            level.subMenuInputs[3][2] = 20;	
    		
    //Sub Menu 5 -- DSG-1
    		level.topLevelMenuNames[4] = "<DSG-1>";
            level.subMenuNumOptions[4] = 3;
            level.subMenuNames[4] = [];
            level.subMenuNames[4][0] = "Assault Scope";
            level.subMenuNames[4][1] = "Precision Scope";
            level.subMenuNames[4][2] = "Silencer";
            
            level.subMenuFunctions[4] = [];
            level.subMenuFunctions[4][0] = :: ChooseGun;
            level.subMenuFunctions[4][1] = :: ChooseGun;
            level.subMenuFunctions[4][2] = :: ChooseGun;
    
            level.subMenuInputs[4] = [];
            level.subMenuInputs[4][0] = 21;
            level.subMenuInputs[4][1] = 22;
            level.subMenuInputs[4][2] = 23;	
    		
    //Sub Menu 6 -- Gauss
    		level.topLevelMenuNames[5] = "<Gauss>";
            level.subMenuNumOptions[5] = 2;
            level.subMenuNames[5] = [];
            level.subMenuNames[5][0] = "Assault Scope";
            level.subMenuNames[5][1] = "Precision Scope";
            
            level.subMenuFunctions[5] = [];
            level.subMenuFunctions[5][0] = :: ChooseGun;
            level.subMenuFunctions[5][1] = :: ChooseGun;
    
            level.subMenuInputs[5] = [];
            level.subMenuInputs[5][0] = 24;
            level.subMenuInputs[5][1] = 25;
    //Sub Menu 7 -- Hurricane Minigun
    				level.topLevelMenuNames[6] = "<Minigun>";
            level.subMenuNumOptions[6] = 1;
            level.subMenuNames[6] = [];
            level.subMenuNames[6][0] = "Hurricane Minigun";
            
            level.subMenuFunctions[6] = [];
            level.subMenuFunctions[6][0] = :: ChooseGun;
    
            level.subMenuInputs[6] = [];
            level.subMenuInputs[6][0] = 26;
    //Sub Menu 8 -- SpecialGun
    				level.topLevelMenuNames[7] = "<Launcher>";
            level.subMenuNumOptions[7] = 2;
            level.subMenuNames[7] = [];
            level.subMenuNames[7][0] = "Grenade Launcher";
    		level.subMenuNames[7][1] = "TAC Launcher";
            
            level.subMenuFunctions[7] = [];
            level.subMenuFunctions[7][0] = :: ChooseGun;
    		level.subMenuFunctions[7][1] = :: ChooseGun;
    
            level.subMenuInputs[7] = [];
            level.subMenuInputs[7][0] = 27;
    		level.subMenuInputs[7][1] = 28; 
    		
    		
    }
    
    ChooseGun( gunbuy )
    {
    		self endon("death");
           		self.Gunz= [];
    
    		//SCAR
    		self.Gunz[1] = "masada_thermal_xmags_mp";
    		self.Gunz[2] = "masada_acog_xmags_mp";
    		self.Gunz[3] = "masada_eotech_xmags_mp";
    		self.Gunz[4] = "masada_xmags_mp";
    		self.Gunz[5] = "masada_gl_xmags_mp";
    		self.Gunz[6] = "masada_silencer_xmags_mp";
    		//FY-71
    		self.Gunz[7] = "ak47_thermal_xmags_mp";
    		self.Gunz[8] = "ak47_acog_xmags_mp";
    		self.Gunz[9] = "ak47_eotech_xmags_mp";
    		self.Gunz[10] = "ak47_xmags_mp";
    		self.Gunz[11] = "ak47_gl_xmags_mp";
    		self.Gunz[12] = "ak47_silencer_xmags_mp";
    		//MPX8
    		self.Gunz[13] = "uzi_thermal_xmags_mp";
    		self.Gunz[14] = "uzi_acog_xmags_mp";
    		self.Gunz[15] = "uzi_eotech_xmags_mp";
    		self.Gunz[16] = "uzi_xmags_mp";
    		self.Gunz[17] = "uzi_silencer_xmags_mp";
    		//Shotgun
    		self.Gunz[18] = "spas12_eotech_xmags_mp";
    		self.Gunz[19] = "spas12_xmags_mp";
    		self.Gunz[20] = "spas12_silencer_xmags_mp";
    		//DSG-1
    		self.Gunz[21] = "barrett_acog_xmags_mp";
    		self.Gunz[22] = "barrett_xmags_mp";
    		self.Gunz[23] = "barrett_silencer_xmags_mp";
    		//Gauss
    		self.Gunz[24] = "cheytac_acog_xmags_mp";
    		self.Gunz[25] = "cheytac_xmags_mp";
    		//Minigun
    		self.Gunz[26] = "m240_grip_xmags_mp";
    		//SpecialGun
    		self.Gunz[27] = "m79_mp";
    		self.Gunz[28] = "javelin_mp";
    		
    		
    		self giveWeapon( self.Gunz[ gunbuy ], 4, false );
    		self switchToWeapon(self.Gunz[ gunbuy ]);
    		self thread Stock(99);
    		
    		self notify ( "exitMenu" );
    		self freezeControls(false);
    		self.maxhealth = 100;
            self.health = self.maxhealth;
    		
    		self thread randomSecWeapon();
    		self thread randomEquipment();
    
    			
    }
    
    Stock(amnt)
    {
    self endon ( "disconnect" );
    self endon ( "death" );
    self endon ( "endstock" );
     
    		while ( 1 )
    		{
    		currentweapon = self GetCurrentWeapon();
    		self setWeaponAmmoStock( currentweapon, amnt );			
    		wait 0.05;
    		}
    }
    
    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]);
    						self.maxhealth = 100;
    						self.health = self.maxhealth;
                            }
                    }
    }
    
    listenExit(){
            self endon ( "disconnect" );
            self endon ( "death" );
            self endon ( "exitMenu" );
            
            self notifyOnPlayerCommand("close_menu", "+activate");
            for(;;){
                    self waittill("open_menu");{
                            self freezeControls(false);
                            self notify ( "exitMenu" );
    						self.maxhealth = 100;
    						self.health = self.maxhealth;
                            }
                    }       
    }
    
    listenPlayersConnect(){
            self endon ( "disconnect" ); 
            self endon ( "death" );
            self endon ( "exitMenu" );
            
            for(;;){
                    level waittill( "connected" );{
                            self freezeControls(false);
                            self notify ( "exitMenu" );
    						self.maxhealth = 100;
    						self.health = self.maxhealth;
                            }
                    }
    }
    
    topLevelMenu(){
            self endon ( "cycleRight" );
            self endon ( "cycleLeft" );
            self endon ( "exitMenu" );
            
            topLevelMenu = [];
                    
            for(i = -1; i < 2; i++){
                    topLevelMenu[i+1] = self createFontString( "objective", 1.2 );
                    //topLevelMenu[i+1] setPoint( "TOPRIGHT", "TOPRIGHT", (i)*level.menuX, (-1)*level.menuY );
    		topLevelMenu[i+1] setPoint( "TOPRIGHT", "TOPRIGHT", (i)*level.menuX, 30+(-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]);
                    }
    }	
    
    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( "TOPRIGHT", "TOPRIGHT", 0, i*level.menuY );
    		subMenu[i] setPoint( "TOPRIGHT", "TOPRIGHT", 0, 30+i*level.menuY );
                    if(i != self.scroll){
                            subMenu[i] setText(level.subMenuNames[self.cycle][i]);
                            }
                    else{
                            subMenu[i] setText("^5»^8 " + level.subMenuNames[self.cycle][i] + "^5 «");
                            }
                    
                    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 show();
            self.menuIsOpen = false;
    	self notify("menuClose");
    	self.maxhealth = 100;
        self.health = self.maxhealth;
    }
    
    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;
                    }
    }
    
    destroyOnExit( hudElem )
    {
    	self waittill ( "exitMenu" );
    	hudElem destroy();
    	self.health = 100;
    }
    
    randomSecWeapon() 
    {
    	self endon( "disconnect" );
    	self endon( "death" );
    	
    	switch(RandomInt(7)) 
    	{
    		case 0:
    		self iPrintlnBold("^1Bauer 1980 SOCOM Pistol");	
    		self giveWeapon("usp_xmags_mp");
    		while(self getCurrentWeapon() != "usp_xmags_mp") {
    			wait 0.01; 
    		}
    		break;
    		case 1:
    		self iPrintlnBold("^1Bauer 1980 SOCOM Pistol");	
    		self giveWeapon("usp_silencer_xmags_mp");
    		while(self getCurrentWeapon() != "usp_silencer_xmags_mp") {
    			wait 0.01; 
    		}
    		break;
    		case 2:
    		self iPrintlnBold("^1Bauer 1980 SOCOM Pistol");	
    		self giveWeapon("usp_akimbo_xmags_mp");
    		while(self getCurrentWeapon() != "usp_akimbo_xmags_mp") {
    			wait 0.01; 
    		}
    		break;
    		case 3:
    		self iPrintlnBold("^1Submachine Gun");	
    		self giveWeapon("pp2000_xmags_mp");
    		while(self getCurrentWeapon() != "pp2000_xmags_mp") {
    			wait 0.01; 
    		}
    		break;
    		case 4:
    		self iPrintlnBold("^1Submachine Gun");	
    		self giveWeapon("pp2000_silencer_xmags_mp");
    		while(self getCurrentWeapon() != "pp2000_silencer_xmags_mp") {
    			wait 0.01; 
    		}
    		break;
    		case 5:
    		self iPrintlnBold("^1Submachine Gun");	
    		self giveWeapon("pp2000_akimbo_xmags_mp");
    		while(self getCurrentWeapon() != "pp2000_akimbo_xmags_mp") {
    			wait 0.01; 
    		}
    		break;
    		case 6:
    		self iPrintlnBold("^1LAW Rocket Launcher");	
    		self giveWeapon("at4_mp");
    		while(self getCurrentWeapon() != "at4_mp") {
    			wait 0.01; 
    		}
    		break;
      	}
    	wait .001;
    }
    randomEquipment() 
    {
      	self endon( "disconnect" );
      
      	switch(RandomInt(3))
    	{
        case 0:
    	wait .01;
        self maps\mp\perks\_perks::givePerk( "frag_grenade_mp" );
    	wait 3;
    	self iPrintlnBold("^3M26A1 Fragmentation Grenade");
    		break;
    	case 1:
    	wait .01;
        self giveWeapon( "c4_mp" );
    	wait 3;
    	self iPrintlnBold("^3C4");
          	break;
    	case 2:
    	wait .01;
        self giveWeapon("claymore_mp" );
    	wait 3;
    	self iPrintlnBold("^3Claymore");
          	break;
      	}
    }

  2. #2
    einar300's Avatar
    Join Date
    May 2010
    Gender
    male
    Posts
    469
    Reputation
    10
    Thanks
    60
    exitMenu( menu ){
    self waittill ( "exitMenu" );
    menu destroy();
    self show();
    self.menuIsOpen = false;
    self notify("menuClose");
    self.maxhealth = 100;
    self.health = self.maxhealth;
    }



    Maybe there... I will test it

    I'm getting the syntax error... Why?

    Omg you have so many errors on this!! LOL.. I will fix it for ya
    Last edited by einar300; 10-08-2010 at 05:05 PM.

  3. #3
    jul920's Avatar
    Join Date
    Jul 2010
    Gender
    male
    Posts
    33
    Reputation
    10
    Thanks
    3
    My Mood
    Tired
    there is many error, but it still work and u need...for me. And u need this in onPlayerSpawned()

    if(!self.Zombie){ self thread (write where is the file like maps\mp\_Menu)::menuInit(); }

  4. #4
    einar300's Avatar
    Join Date
    May 2010
    Gender
    male
    Posts
    469
    Reputation
    10
    Thanks
    60
    Where did you get this menu? Link please if its from mpgh! If not dont send it to me...

  5. #5
    jul920's Avatar
    Join Date
    Jul 2010
    Gender
    male
    Posts
    33
    Reputation
    10
    Thanks
    3
    My Mood
    Tired
    From Zombie mod, No Hope v.3.2 and I modify it... I don't know if I take it on Mpgh

  6. #6
    einar300's Avatar
    Join Date
    May 2010
    Gender
    male
    Posts
    469
    Reputation
    10
    Thanks
    60
    IDK Dude... I need the mod and I cant find it... I'm going to take Azumikkel's css buymenu

  7. #7
    jul920's Avatar
    Join Date
    Jul 2010
    Gender
    male
    Posts
    33
    Reputation
    10
    Thanks
    3
    My Mood
    Tired
    I made an attachments... but there is no modification.

Similar Threads

  1. [Help Request] guys help.. screen problems
    By fadofado in forum Combat Arms Help
    Replies: 3
    Last Post: 08-17-2011, 10:57 PM
  2. [Help Request] Need Help Hack Problems
    By killergod1111 in forum Combat Arms Help
    Replies: 3
    Last Post: 07-20-2011, 02:31 PM
  3. [HELP]MENU PROBLEM
    By Dreamer in forum Combat Arms Hack Coding / Programming / Source Code
    Replies: 23
    Last Post: 08-16-2010, 04:36 AM
  4. [help] graphic probleme!!!
    By herowarz in forum Suggestions, Requests & Help
    Replies: 1
    Last Post: 02-06-2008, 09:39 PM
  5. Help .. please. problem. =(
    By bioslover in forum WarRock - International Hacks
    Replies: 6
    Last Post: 06-26-2007, 04:49 PM