Fulqrum Publishing Home   |   Register   |   Today Posts   |   Members   |   UserCP   |   Calendar   |   Search   |   FAQ

Go Back   Official Fulqrum Publishing forum > Fulqrum Publishing > IL-2 Sturmovik: Cliffs of Dover > FMB, Mission & Campaign builder Discussions

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #4  
Old 02-07-2012, 01:43 PM
salmo salmo is offline
Approved Member
 
Join Date: Mar 2011
Posts: 632
Default

Stop landing at enemy airfields ....

Code:
    public override void OnAircraftLanded(int missionNumber, string shortName, AiAircraft aircraft)
    {
        base.OnAircraftLanded(missionNumber, shortName, aircraft);
        foreach (AiBirthPlace bp in GamePlay.gpBirthPlaces())
        {
            double CircleRadius = 1000.00;
            if (Math.Sqrt(Math.Pow((bp.Pos().x - aircraft.Pos().x), 2) + (Math.Pow((bp.Pos().y - aircraft.Pos().y), 2))) <= CircleRadius)
            {
                // landed within 1km of an airbase
                if(bp.Army() != aircraft.Army())
                {
                    // landed at enemy base so penalise the player
                    sendScreenMessageToPilot(aircraft, "Not allowed to land at enemy base " + bp.Name().ToString(), null);
                    // add any penalties here

                }   
            }
        }
    }

    private void sendScreenMessageToPilot(AiAircraft aircraft, string msg, object[] parms)
    {   // send a screen message to the pilot of specified aircraft ONLY
        GamePlay.gpHUDLogCenter(new Player[] { aircraft.Player(0) }, msg, null);
    }
__________________
When one engine fails on a two engine bomber, you will always have enough power left to get to the scene of the crash.

Get the latest COD Team Fusion patch info HERE

Last edited by salmo; 02-07-2012 at 03:10 PM.
Reply With Quote
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 05:50 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright © 2007 Fulqrum Publishing. All rights reserved.