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 05-15-2012, 11:34 PM
Smokeynz Smokeynz is offline
Approved Member
 
Join Date: Apr 2011
Posts: 106
Default

I use this, slight variation to other methods, which are similar.

Note for arguments, like a set time you added, you need to place the value you want in the new object , note I set "timevalue"
Note: for screen hud messages, to avoid messages overwritting each other on screen to quickly, you add a timeout to delay the writtern message.

My version displays on screen and in log, so the message can be recalled by player.

Code:
ScreenMsg(-1, "MissionMessageToALL");
Timeout(2.0, () =>
{
   ScreenMsg(1, "RAF fly CAP between Calais and Dover");
   ScreenMsg(2, "LW meet a flight of Do17s 5000m over Calais in appr. {0} min.! Escort them", new object[] { timevalue });
 });

Code:
private void ScreenMsg(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);
            GamePlay.gpLogServer(null, msg, args);
        }
        else if (Consignees.Exists(item => item.Army() == army))
        {
            GamePlay.gpHUDLogCenter(Consignees.FindAll(item => item.Army() == army).ToArray(), msg, args);
            GamePlay.gpLogServer(Consignees.FindAll(item => item.Army() == army).ToArray(), msg, args);
        }
    }
Reply With Quote
 

Thread Tools
Display Modes

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 11:35 PM.


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