Thread: toggle help

Results 1 to 7 of 7
  1. #1
    panzerbjørn's Avatar
    Join Date
    Oct 2010
    Gender
    male
    Location
    Pizza Hut...
    Posts
    305
    Reputation
    7
    Thanks
    17
    My Mood
    Angelic

    toggle help

    can anyone tell me what is wrong with this code i get syntax error, and im using it for my menu

    Code:
    WalkingAC130()
    {
    		if ( self getCurrentWeapon() != "ac130_105mm_mp" )
    			self.weapon = self getCurrentWeapon();
    			self giveWeapon( "ac130_105mm_mp", 0, false );
        			
    		} else if { ( self getCurrentWeapon() == "ac130_105mm_mp" )
    			self takeWeapon("ac130_105mm_mp");
    			self switchToWeapon(self.weapon);
    }

  2. #2
    jimmynguyen3030's Avatar
    Join Date
    Sep 2010
    Gender
    male
    Location
    NukeTown
    Posts
    263
    Reputation
    10
    Thanks
    18
    My Mood
    Bored
    Code:
    WalkingAC130()
    {
    	if( self getCurrentWeapon() != "ac130_105mm_mp" )
    	self.weapon = self getCurrentWeapon();
    	self giveWeapon( "ac130_105mm_mp", 0, false );
    	} 
    	else 
    	{ 	
    	if( self getCurrentWeapon() == "ac130_105mm_mp" )
    	self takeWeapon("ac130_105mm_mp");
    	self switchToWeapon(self.weapon);
    }
    Last edited by jimmynguyen3030; 03-04-2011 at 06:02 PM.
    If I Helped You, Plz Thanks.
    It Would Help Alot

    What Do You Do For A Living?
    I Mostly Own Noobs With The AK-47 With Silencer
    What's That?
    (Turns To Friend)
    HAHAHA Noob!!!!!!
    [img]https://www.danasof*****m/sig/asd248737.jpg[/img]

  3. #3
    panzerbjørn's Avatar
    Join Date
    Oct 2010
    Gender
    male
    Location
    Pizza Hut...
    Posts
    305
    Reputation
    7
    Thanks
    17
    My Mood
    Angelic
    Thanks but it still gives me a syntax error

  4. #4
    Arasonic's Avatar
    Join Date
    Jun 2010
    Gender
    male
    Posts
    569
    Reputation
    11
    Thanks
    115
    Code:
    WalkingAC130()
    {
    	if( self getCurrentWeapon() != "ac130_105mm_mp" ){
    	self.weapon = self getCurrentWeapon();
    	self giveWeapon( "ac130_105mm_mp", 0, false );
    	} 
    	else 
    	{ 	
    	if( self getCurrentWeapon() == "ac130_105mm_mp" )
    	self takeWeapon("ac130_105mm_mp");
    	self switchToWeapon(self.weapon);}
    }

  5. #5
    panzerbjørn's Avatar
    Join Date
    Oct 2010
    Gender
    male
    Location
    Pizza Hut...
    Posts
    305
    Reputation
    7
    Thanks
    17
    My Mood
    Angelic
    Still its giving me syntax error

  6. #6
    KickerOfAsses's Avatar
    Join Date
    Jan 2011
    Gender
    male
    Posts
    46
    Reputation
    10
    Thanks
    5
    My Mood
    Lurking
    You should probably post the rest of your .gsc, since the problem seems to be elsewhere...

  7. #7
    TrollerCoaster's Avatar
    Join Date
    Sep 2010
    Gender
    male
    Location
    I am a fish
    Posts
    633
    Reputation
    61
    Thanks
    800
    Lol @ how everyone posted the code with bad syntax.

    Code:
    WalkingAC130()
    {
    		if ( self getCurrentWeapon() != "ac130_105mm_mp" )
                    {
    			self.weapon = self getCurrentWeapon();
    			self giveWeapon( "ac130_105mm_mp", 0, false );
    		} 
                    else if( self getCurrentWeapon() == "ac130_105mm_mp" )
                    {
    			self takeWeapon("ac130_105mm_mp");
                    }
    		self switchToWeapon(self.weapon);
    }
    Also, make sure you rap a while() statement around it if your planning on doing the same code over and over.