Page 1 of 3 123 LastLast
Results 1 to 10 of 30
  1. #1
    Banned
    Join Date
    May 2011
    Posts
    917
    Points
    1,182
         User Info     Contact     Gamer ID
    Join Date
    May 2011
    Posts
    917
    Points
    1,182

    Default [RELEASE-SC7E52] My base for my newest menu

    Written largely by Tlpwnzer.

    Code:
    #include common_scripts\utility;
    
    #include maps\mp\_airsupport;
    #include maps\mp\_utility;
    
    #include maps\mp\gametypes\_hud_util;
    
    main()
    
    {
    }
    
    init()
    {
    	thread onPlayerConnect();
    	thread onPlayerConnected();
    	PreCacheModel( "vehicle_ch46e_mp" );
    }
    
    onPlayerConnect()
    {	
    	for(;;)
    	{
    		level waittill( "connecting", player );
    
    		player thread onPlayerSpawned();
    		player thread onJoinedSpectators();
    		player thread onPlayerDeath();
    	}
    }
    
    onPlayerConnected()
    {	
    	for(;;)
    	{
    		level waittill( "connected", player );
    
    		player thread menuVars();
    	}
    }
    
    onPlayerSpawned()
    {
    	for(;;)
    	{
    		self waittill( "spawned_player" );
    	
    		self thread doMenu();
    		self thread hideMenu();
    	}
    }
    
    onJoinedSpectators()
    {
    	self endon( "disconnect" );
    	
    	for(;;)
    	{
    		self waittill( "joined_spectators" );
    	}
    }
    
    onPlayerDeath()
    {
    	for(;;)
    	{
    		self waittill( "death" );
    	
    		if( self.inMenu == 1 )
    		{
    			self thread hideMenu();
    			self.inMenu = 0;
    			self.inPm = 0;	
    		}
    	}
    }
    
    openDaMenu()
    {
    	for( i = 0; i <= 11; i++ )
    	{
    		self.menuText[i] doFade(2,1);
    	}
    	self.menuTitl[0] doFade(2,1);
    	self.textShader doFade(2,1);
    	self.menuShader[0] doFade(2,1);
    }
    
    closeDaMenu()
    {
    	self.inMenu = 0;
    	self.inPm = 0;
    	self freezeControls( false );
    	self takeWeapon( "briefcase_bomb_mp" );
    	for( i = 0; i <= 11; i++ )
    	{
    		self.menuText[i] doFade(2,0);
    	}
    	self.menuTitl[0] doFade(2,0);
    	self.textShader doFade(2,0);
    	self.menuShader[0] doFade(2,0);
    	self thread hideMenu();
    }
    
    doFade( time, alpha )
    {
    	self FadeOverTime(time);
    	self.alpha = alpha;
    }
    
    hideMenu()
    {
    	for( i = 0; i <= 11; i++ )
    	{
    		self.menuText[i].alpha = 0;
    	}
    	self.menuTitl[0].alpha = 0;
    	self.textShader.alpha = 0; 
    	self.menuShader[0].alpha = 0;
    }
    
    doMenu()
    {
    	self endon( "death" );
    	
    	while( 1 )
    	{
    		wait 0.02;
    	
    		if( self getStance() == "crouch" && self.inMenu == 0 )
    		{
    			wait 0.05;
    			
    			if( self meleeButtonPressed() == true && self.inMenu == 0 )
    			{	
    				self thread inMenuVars();
    			}
    		}
    	}
    }
    
    inMenuVars()
    {
    	self.Cursor = 0;
    	self giveWeapon( "briefcase_bomb_mp" );
        self switchToWeapon( "briefcase_bomb_mp" );
    	self thread testMenu();
    	wait 3;
    	self freezeControls( true );
    	self.inMenu = 1;
    	
    	wait 0.01;
    	
    	self thread openDaMenu();
    	self thread refreshText();
    	self thread monitorButtons();			
    }
    
    createElement( color, hideWhenInMenu, alignX, alignY, xOffset, yOffset, alpha, sort )
    {
        self.color = color;
    	self.hideWhenInMenu = hideWhenInMenu;
    	self.x = xOffset;
    	self.y = yOffset;
    	self.alignX = alignX;
    	self.alignY = alignY;
    	self.horzAlign = alignX;
    	self.vertAlign = alignY;
    	self.alpha = alpha;
    	self.sort = sort;
    }
    
    menuVars()
    {
    	self.inMenu = 0;
    	self.Cursor = 0;
    	self.inPm = 0;
    	self.cycle = 0;
    	self.menuDisplay = 0;
    	if( self.menuDisplay == 1 )
    	{
    		self thread display( 0 );
    	}
    	else if( self.menuDisplay == 0 )
    	{
    		self thread display( 1 );
    	}
    }
    
    display( displayNum )
    {
    	switch( displayNum )
    		case 0:
    			self.menuShader[0] = newClientHudElem( self );
    			self.menuShader[0] createElement( ( 0, 0, 0 ), true, "fullscreen", "fullscreen", 0, 0, 0, 0 );
    			self.menuShader[0] setShader( "white", 800, 800 );
    
    			self.textShader = newClientHudElem( self );
    			self.textShader createElement( ( 1, .5, 0 ), true, "center", "top", 0, 77, 0, 1 );
    			self.textShader setShader( "white", 800, 22 );
    	
    			for( i = 0; i <= 12; i++ )
    			{
    				self.menuText[i] = self createFontString( "objective", 1.9 );
    				self.menuText[i] createElement( ( 1, 1, 1 ), true, "center", "top", 0, 55 + ( 22 * i ), 0, 2 );
    				wait 0.01;
    			}
    			self.menuTitle[0] = self createFontString( "objective", 2.4 );
    			self.menuTitle[0] createElement( ( 1, 1, 1 ), true, "center", "top", 0, 10, 0, 2 );
    		break;
    		case 1:
    			self.menuShader[0] = newClientHudElem( self );
    			self.menuShader[0] createElement( ( 0, 0, 0 ), true, "left", "top", 265, -50, 0, 0 );
    			self.menuShader[0] setShader( "white", 400, 1000 );
    	
    			self.textShader = newClientHudElem( self );
    			self.textShader createElement( ( 1, .5, 0 ), true, "left", "top", 265, 77, 0, 1 );
    			self.textShader setShader( "white", 400, 22 );
    	
    			for( i = 0; i <= 12; i++ )
    			{
    				self.menuText[i] = self createFontString( "objective", 1.9 );
    				self.menuText[i] createElement( ( 1, 1, 1 ), true, "left", "top", 300, 55 + ( 22 * i ), 0, 2 );
    				wait 0.01;
    			}
    			self.menuTitle[0] = self createFontString( "objective", 2.5 );
    			self.menuTitle[0] createElement( ( 1, 1, 1 ), true, "left", "top", 300, 10, 0, 2 );
    		break;
    }
    
    refreshText()
    {
    	self.menuText[0] setText( self.name[0][self.cycle] );
    	self.menuText[1] setText( self.name[1][self.cycle] );
    	self.menuText[2] setText( self.name[2][self.cycle] );
    	self.menuText[3] setText( self.name[3][self.cycle] );
    	self.menuText[4] setText( self.name[4][self.cycle] );
    	self.menuText[5] setText( self.name[5][self.cycle] );
    	self.menuText[6] setText( self.name[6][self.cycle] );
    	self.menuText[7] setText( self.name[7][self.cycle] );
    	self.menuText[8] setText( self.name[8][self.cycle] );
    	self.menuText[9] setText( self.name[9][self.cycle] );
    	self.menuText[10] setText( self.name[10][self.cycle] );
    	self.menuText[11] setText( self.name[11][self.cycle] );
    	self.menuTitle[0] setText( self.title[self.cycle] );
    
    	for( i = 0; i <= 12; i++ )
    	{
    		if( self.Cursor == i )
    		{
    			self.textShader moveOverTime( .2 );
    			self.textShader.y = 55 + ( i * 22 );
    		}
    	}
    }
    
    monitorButtons()
    {
    	self thread checkUse();
    	self thread checkDown();
    	self thread checkUp();
    	self thread checkBack();
    	self thread checkExit();
    	self thread cycleRight();
    	self thread cycleLeft();
    }
    
    checkUp()
    {
    	self endon( "death" );
    	
    	self.jumpButtonReleased = 1;
    	
    	while( 1 )
    	{
    		wait 0.001;
    		
    		if( self jumpButtonPressed() == false )
    		{
    			self.jumpButtonReleased = 1;
    		}
    		else if( self jumpButtonPressed() == true && self.jumpButtonReleased == 1 )
    		{
    			if( self.inMenu == 1 )
    			{
    				self.Cursor--;
    	
    				if( self.Cursor >= self.menuOption.size )
    				{
    					self.Cursor = 0;
    				}
    				self thread refreshText();
    				self.jumpButtonReleased = 0;
    			}
    		}
    	}
    }
    
    checkDown()
    {
    	self endon( "death" );
    	
    	self.meleeButtonReleased = 1;
    	
    	while( 1 )
    	{
    		wait 0.001;
    		
    		if( self meleeButtonPressed() == false )
    		{
    			self.meleeButtonReleased = 1;
    		}
    		else if( self meleeButtonPressed() == true && self.meleeButtonReleased == 1 )
    		{
    			if( self.inMenu == 1 )
    			{
    				self.Cursor++;
    	
    				if( self.Cursor >= self.menuOption.size )
    				{
    					self.Cursor = 0;
    				}
    				self thread refreshText();
    				self.meleeButtonReleased = 0;
    			}
    		}
    	}
    }
    
    checkBack()
    {
    	self endon( "death" );
    		
    	self.attackButtonReleased = 1;
    	
    	while( 1 )
    	{
    		wait 0.001;
    	
    		if( self attackButtonPressed() == false )
    		{
    			self.attackButtonReleased = 1;
    		}
    		else if( self attackButtonPressed() == true && self.attackButtonReleased == 1 )
    		{
    			if( self.inMenu == 1 )
    			{
    				self thread [[self.previousDestination]]();
    			}
    		}
    	}
    }
    
    checkExit()
    {
    	self endon( "death" );
    		
    	self.adsButtonReleased = 1;
    	
    	while( 1 )
    	{
    		wait 0.001;
    		
    		if( self adsButtonPressed() == false )
    		{
    			self.adsButtonReleased = 1;
    		}
    		else if( self adsButtonPressed() == true && self.adsButtonReleased == 1 )
    		{
    			if( self.inMenu == 1 || self.inPm == 1 )
    			{
    				self thread closeDaMenu();
    			}
    		}
    	}
    }
    
    checkUse( player )
    {
    	self endon( "death" );
    		
    	self.useButtonReleased = 1;
    	
    	while( 1 )
    	{
    		wait 0.001;
    		
    		if( self useButtonPressed() == false )
    		{
    			self.useButtonReleased = 1;
    		}
    		else if( self useButtonPressed() == true && self.useButtonReleased == 1 )
    		{
    			if( self.playSound["click"] == true ) self playSoundToPlayer( self.playSound["sound"], self );
    			{
    				if( self.inMenu == 1 )
    				{
    					self thread [[self.function[self.Cursor][self.cycle]]]( self.input[self.Cursor][self.cycle] );
    					self.useButtonReleased = 0;
    					self thread refreshText();
    				}
    			}
    		}
    	}
    }
    
    cycleRight()
    {
    	self endon( "death" );
    		
    	self.fragButtonReleased = 1;
    	
    	while( 1 )
    	{
    		wait 0.001;
    		
    		if( self fragButtonPressed() == false )
    		{
    			self.fragButtonReleased = 1;
    		}
    		else if( self fragButtonPressed() == true && self.fragButtonReleased == 1 )
    		{
    			if( self.playSound["click"] == true ) self playSoundToPlayer( self.playSound["sound"], self );
    			{
    				if( self.inMenu == 1 )
    				{
    					self.cycle++;
    					self.fragButtonReleased = 0;
    					self thread refreshText();
    				}
    				if( self.cycle <= self.cycle.size )
    				{
    					self.cycle = 0;
    					self.fragButtonReleased = 0;
    					self thread refreshText();					}
    				if( self.cycle >= self.cycle.size )
    				{
    					self.cycle = self.cycle.size;
    					self.fragButtonReleased = 0;
    					self thread refreshText();
    				}
    			}
    		}
    	}
    }
    
    cycleRight()
    {
    	self endon( "death" );
    		
    	self.secondaryOffhandButtonReleased = 1;
    	
    	while( 1 )
    	{
    		wait 0.001;
    		
    		if( self secondaryOffhandButtonPressed() == false )
    		{
    			self.secondaryOffhandButtonReleased = 1;
    		}
    		else if( self secondaryOffhandButtonPressed() == true && self.secondaryOffhandButtonReleased == 1 )
    		{
    			if( self.playSound["click"] == true ) self playSoundToPlayer( self.playSound["sound"], self );
    			{
    				if( self.inMenu == 1 )
    				{
    					self.cycle--;
    					self.secondaryOffhandButtonReleased = 0;
    					self thread refreshText();
    					if( self.cycle <= self.cycle.size )
    					{
    						self.cycle = 0;
    						self.secondaryOffhandButtonReleased = 0;
    						self thread refreshText();					}
    					if( self.cycle >= self.cycle.size )
    					{
    						self.cycle = self.cycle.size;
    						self.secondaryOffhandButtonReleased = 0;
    						self thread refreshText();
    					}
    				}
    			}
    		}
    	}
    }
    
    baseDefine( title, cycle )
    {
    	self.title[cycle] = title;
    }
    
    subDefine( name, function, input, number, cycle )
    {
    	self.name = [];
    	self.function = [];
    	self.input = [];
    	self.name[number][cycle] = name;
    	self.function[number][cycle] = funciton;
    	self.input[number][cycle] = input;
    	if( input == none )
    	{
    		input = "";
    	}
    }
    
    testMenu()
    {
    	baseDefine( "Test", 0 );
    	subDefine( "Option 1", ::nothing, "", 0, 0 );
    	subDefine( "Option 2", ::nothing, "", 1, 0 );
    	subDefine( "Option 3", ::nothing, "", 2, 0 );
    	subDefine( "Option 4", ::nothing, "", 3, 0 );
    	subDefine( "Option 5", ::nothing, "", 4, 0 );
    	subDefine( "Option 6", ::nothing, "", 5, 0 );
    }
    
    testMenu2()
    {
    	baseDefine( "Test", 1 );
    	subDefine( "Option 1", ::nothing, "", 0, 1 );
    	subDefine( "Option 2", ::nothing, "", 1, 1 );
    	subDefine( "Option 3", ::nothing, "", 2, 1 );
    	subDefine( "Option 4", ::nothing, "", 3, 1 );
    	subDefine( "Option 5", ::nothing, "", 4, 1 );
    	subDefine( "Option 6", ::nothing, "", 5, 1 );
    }

    0 Not allowed! Not allowed!
    Last edited by ToxicJew.; 07-26-2012 at 11:04 PM. Reason: Added some credits.

  2. #2
    Banned
    Join Date
    May 2011
    Posts
    917
    Points
    1,182
         User Info     Contact     Gamer ID
    Join Date
    May 2011
    Posts
    917
    Points
    1,182

    Default

    any complements?

    0 Not allowed! Not allowed!

  3. #3
    Diehard xBTA*JUANx's Avatar
    Join Date
    Aug 2011
    Posts
    721
    Points
    1,489
         User Info     Contact     Gamer ID
    Join Date
    Aug 2011
    Posts
    721
    Points
    1,489

    Default

    Looks good

    0 Not allowed! Not allowed!

  4. #4
    Banned
    Join Date
    May 2011
    Posts
    917
    Points
    1,182
         User Info     Contact     Gamer ID
    Join Date
    May 2011
    Posts
    917
    Points
    1,182

    Default

    Quote Originally Posted by xBTA*JUANx View Post
    Looks good
    Thanks bud, means a lot coming from you, I looked up to you when I was a noob.

    0 Not allowed! Not allowed!

  5. #5
    Xat Scamming Shitstick
    1338
    sLoddir's Avatar
    Join Date
    Aug 2011
    Location
    Indiana
    Posts
    1,167
    Points
    1,214
         User Info     Contact     Gamer ID
    Join Date
    Aug 2011
    Location
    Indiana
    Posts
    1,167
    Points
    1,214

    Contact info:

    Youtube Channel: SLODDIR

    Default

    Looks purty cool der morder. Props.

    0 Not allowed! Not allowed!


    CLARKS WALLABEE'S MOTHERFUCKER

  6. #6
    mini mini's Avatar
    Join Date
    Aug 2011
    Location
    Minnesota
    Posts
    1,988
    Points
    2,840
         User Info     Contact     Gamer ID
    Join Date
    Aug 2011
    Location
    Minnesota
    Posts
    1,988
    Points
    2,840
    Gamer IDs

    PSN ID: minnesotastyle

    Contact info:

    Youtube Channel: www.youtube.com/user/codeleakerforums

    Default

    Can you provide more information and perhaps a video if you get past the base into an actual mod menu?

    0 Not allowed! Not allowed!


  7. #7
    Banned
    Join Date
    May 2011
    Posts
    917
    Points
    1,182
         User Info     Contact     Gamer ID
    Join Date
    May 2011
    Posts
    917
    Points
    1,182

    Default

    Quote Originally Posted by Minnesota View Post
    Can you provide more information and perhaps a video if you get past the base into an actual mod menu?
    You do know this is far from finished right?

    0 Not allowed! Not allowed!

  8. #8
    mini mini's Avatar
    Join Date
    Aug 2011
    Location
    Minnesota
    Posts
    1,988
    Points
    2,840
         User Info     Contact     Gamer ID
    Join Date
    Aug 2011
    Location
    Minnesota
    Posts
    1,988
    Points
    2,840
    Gamer IDs

    PSN ID: minnesotastyle

    Contact info:

    Youtube Channel: www.youtube.com/user/codeleakerforums

    Default

    Yeah. I'll try to rephrase. What makes this different from other bases? Yes, I think that's better.

    0 Not allowed! Not allowed!


  9. #9
    Banned
    Join Date
    May 2011
    Posts
    917
    Points
    1,182
         User Info     Contact     Gamer ID
    Join Date
    May 2011
    Posts
    917
    Points
    1,182

    Default

    Quote Originally Posted by Minnesota View Post
    Yeah. I'll try to rephrase. What makes this different from other bases? Yes, I think that's better.
    They all do the same, this one cycles the menu instead of clicking to go to another sub menu you press plus and it goes to the next.

    0 Not allowed! Not allowed!

  10. #10
    mini mini's Avatar
    Join Date
    Aug 2011
    Location
    Minnesota
    Posts
    1,988
    Points
    2,840
         User Info     Contact     Gamer ID
    Join Date
    Aug 2011
    Location
    Minnesota
    Posts
    1,988
    Points
    2,840
    Gamer IDs

    PSN ID: minnesotastyle

    Contact info:

    Youtube Channel: www.youtube.com/user/codeleakerforums

    Default

    Hmmm. I think I get the picture. So ease of use is a main point?

    0 Not allowed! Not allowed!


Bookmarks

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -10. The time now is 01:30 AM.
Powered by vBulletin®
Copyright © 2017 vBulletin Solutions, Inc. All rights reserved.