View Single Post
  #3  
Old 03-21-2012, 08:38 AM
hc_wolf hc_wolf is offline
Approved Member
 
Join Date: Jul 2010
Posts: 439
Default

FG28_Kodiak I tried this with a number of other changes but I keep getting the following server error.

The name 'action' does not exist in the current context.
I have looked at other coding and can not see the problem.


Code:
	

base.OnTrigger(missionNumber, shortName, active);	
	   
	   List<string> ActionToDoList = new List<string>{"action17", "action18", "action19", "action20", "action21", "action22"};    
		        
		if ("G17".Equals(shortName) && active)
        {
  		ActionToDoList.ForEach(item =>
		{	
				if (action != null)
				{
                action.Do();
				}
 
			});
		}

and if I use this code I get another error saying Invalid expression term 'if'
Code:
	   List<string> ActionToDoList = new List<string>{"action17", "action18", "action19", "action20", "action21", "action22"};    
		        
		if ("G17".Equals(shortName) && active)
        {
			ActionToDoList.ForEach(item =>
			
			if (action != null)
				{
                action.Do();
				}

			});
__________________
__________________
Win7, 64bit Ultra
Asus P8P67Pro MB
Intel i7-2600K
Coursair 16GB (4x 4GB), DDR3-1600MHz
Gainward Nvidia 580GTX 3GB DDR5
850-Watt Modular Power Supply
WIN7 and COD on Gskill SSD 240GB
40" Panasonic LCD
TrackIR5 +
Thrustmaster Warthog stick, throttle & pedals

Last edited by hc_wolf; 03-21-2012 at 08:20 PM.
Reply With Quote