View Single Post
  #167  
Old 05-25-2011, 07:57 AM
klem's Avatar
klem klem is offline
Approved Member
 
Join Date: Nov 2007
Posts: 1,653
Default

I'm having trouble giving messages to a particular side under OnTickGame because I don't know how to find out which side I am on (" 'aircraft' is not valid in this context"). Any ideas please?

Code:
public override void OnTickGame()

       {

	   if (Time.tickCounter() % 115200 == 1980) // Testing, reduced to 1 min. 1980 = 60secs delay.
	   {
		GamePlay.gpHUDLogCenter("1 minute Timetick message.");
               //issue message after further 30 seconds (test)
		double initTime = 0.0;
		Timeout(initTime += 30, () =>
		     if (aircraft != null)     //error the name aircraft does not exist in the current context
		           {
		           switch (aircraft.Army())		           {                
		    	    case 1:
			      { GamePlay.gpHUDLogCenter("Red side message."); }
             	            break;
	            	    case 2:
			      { GamePlay.gpHUDLogCenter("Blue side message"); }               
			    break;
	    	          }
                     });
           }

      }
__________________
klem
56 Squadron RAF "Firebirds"
http://firebirds.2ndtaf.org.uk/



ASUS Sabertooth X58 /i7 950 @ 4GHz / 6Gb DDR3 1600 CAS8 / EVGA GTX570 GPU 1.28Gb superclocked / Crucial 128Gb SSD SATA III 6Gb/s, 355Mb-215Mb Read-Write / 850W PSU
Windows 7 64 bit Home Premium / Samsung 22" 226BW @ 1680 x 1050 / TrackIR4 with TrackIR5 software / Saitek X52 Pro & Rudders
Reply With Quote