Thread: chat messages
View Single Post
  #8  
Old 03-12-2012, 08:56 AM
FG28_Kodiak FG28_Kodiak is offline
Approved Member
 
Join Date: Dec 2009
Location: Swabia->Bavaria->Germany
Posts: 884
Default

@_79_dev

Code:
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using maddox.game;
using maddox.game.world;
using maddox.GP;


public class Mission : AMission
{


    private void sendChatMessage(string msg, params object[] args)
    {
        GamePlay.gpLogServer(null, msg, args);
    }


    private void sendChatMessage(Player player, string msg, params object[] args)
    {
        if (player != null)
            GamePlay.gpLogServer(new Player[] { player }, msg, args);
    }


    private void sendChatMessage(int army, string msg, params object[] args)
    {
        List<Player> Consignees = new List<Player>();

        if (GamePlay.gpPlayer() != null)
            Consignees.Add(GamePlay.gpPlayer());
        if (GamePlay.gpRemotePlayers() != null)
            Consignees.AddRange(GamePlay.gpRemotePlayers());

        if (army == -1)
            GamePlay.gpLogServer(null, msg, args);
        else if (Consignees.Exists(item => item.Army() == army))
            GamePlay.gpLogServer(Consignees.FindAll(item => item.Army() == army).ToArray(), msg, args);
    }


    private void sendScreenMessage(string msg, params object[] args)
    {
        GamePlay.gpHUDLogCenter(null, msg, args);
    }


    private void sendScreenMessage(Player player, string msg, params object[] args)
    {
        if (player != null)
            GamePlay.gpHUDLogCenter(new Player[] { player }, msg, args);
    }


    private void sendScreenMessage(int army, string msg, params object[] args)
    {
        List<Player> Consignees = new List<Player>();

        if (GamePlay.gpPlayer() != null)
            Consignees.Add(GamePlay.gpPlayer());
        if (GamePlay.gpRemotePlayers() != null)
            Consignees.AddRange(GamePlay.gpRemotePlayers());

        if (army == -1)
            GamePlay.gpHUDLogCenter(null, msg, args);
        else if (Consignees.Exists(item => item.Army() == army))
            GamePlay.gpHUDLogCenter(Consignees.FindAll(item => item.Army() == army).ToArray(), msg, args);
    }


 public override void OnAircraftTookOff(int missionNumber, string shortName, AiAircraft aircraft)
    {
        #region stats
        base.OnAircraftTookOff(missionNumber, shortName, aircraft);
        try
        {
            stats.aircraftTakeoff(shortName, aircraft);
        }
        catch (Exception ex)
        {
            System.Console.WriteLine("Stats.OnAircraftTookOff - Exception: " + ex);
        }

       #endregion

        sendChatMessage(aircraft.Army(), " _79_dev has a problem");

            //add your code here
    }

}
Reply With Quote