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
  #6  
Old 08-16-2011, 09:19 AM
FG28_Kodiak FG28_Kodiak is offline
Approved Member
 
Join Date: Dec 2009
Location: Swabia->Bavaria->Germany
Posts: 884
Default

Code:
using System;
using maddox.game;
using maddox.game.world;
using System.Diagnostics; // for Stopwatch timer

public class Mission : AMission
{

    Stopwatch PlayerGroupIdleTimer = new Stopwatch();
    const int PlayerAirgroupIdleTimeMinutes = 3;  // 3 minutes for player to warm up his engine

    public override void OnPlaceEnter(Player player, AiActor actor, int placeIndex)
    {
        base.OnPlaceEnter(player, actor, placeIndex);
        
        AiAircraft airc1 = (AiAircraft)GamePlay.gpPlayer().Place();
        
        PlayerGroupIdleTimer.Start();

        if (!airc1.IsAirborne())
        {
            airc1.AirGroup().Idle = true;
            GamePlay.gpHUDLogCenter(player.Name() + " warm up your engine");
        }

    }

    public override void OnTickGame()
    {
        base.OnTickGame();

        //check mission timers
        if (PlayerGroupIdleTimer.Elapsed.Minutes >= PlayerAirgroupIdleTimeMinutes)
        {
            PlayerGroupIdleTimer.Reset(); //Set timer to 0
            PlayerGroupIdleTimer.Stop(); 

            AiAircraft airc1 = (AiAircraft)GamePlay.gpPlayer().Place();
            airc1.AirGroup().Idle = false;
        }
    }
}

Last edited by FG28_Kodiak; 08-16-2011 at 10:09 AM.
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 10:58 PM.


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