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
  #2  
Old 03-10-2012, 12:22 PM
salmo salmo is offline
Approved Member
 
Join Date: Mar 2011
Posts: 632
Default

Chat when aircraft takes off
Code:
public override void OnAircraftTookOff(int missionNumber, string shortName, AiAircraft aircraft)
    {
     sendChatMessageTo(aircraft.Army(), "The aircraft took off", null);
    }

    private void sendChatMessageTo(int army, string msg, object[] parms)
    {   // send a chat message to all players in specified army (1=red; 2=blue)
        List<Player> Players = new List<Player>();
        // on Dedi the server:
        if (GamePlay.gpPlayer() != null)
        {
            if (GamePlay.gpPlayer().Army() == army || army == -1)
                Players.Add(GamePlay.gpPlayer());
        } //rest of the crowd
        if (GamePlay.gpRemotePlayers() != null || GamePlay.gpRemotePlayers().Length > 0)
        {
            foreach (Player p in GamePlay.gpRemotePlayers())
            {
                if (p.Army() == army || army == -1)
                    Players.Add(p);
            }
        }
        if (Players != null && Players.Count > 0)
            GamePlay.gpLogServer(Players.ToArray(), msg, parms);
    }
Chat every 15 minutes
Code:
public class Mission : AMission
{
Stopwatch missionTimer = new Stopwatch();

public override void OnBattleStarted()
    {
        base.OnBattleStarted();
        missionTimer.Start();
    }

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

        if (missionTimer.Elapsed.Minutes >= 15)
        {
            missionTimer.Restart();
            sendChatMessageTo(-1, "Chat every 15 min", null);  // chat to all players
        }
     }

}
__________________
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; 03-10-2012 at 12:30 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 02:52 AM.


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