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

Reply
 
Thread Tools Display Modes
  #1  
Old 11-15-2011, 08:16 AM
salmo salmo is offline
Approved Member
 
Join Date: Mar 2011
Posts: 632
Default How to send message to player at takeoff?

How to send a message only to the player who has just taken off? I have this so far ...

code removed by author

As you can see, I've tried sending the GamePlay.gpHUDLogCenter text to ThePlane.AiActor.Name() and AiActor.Name() which produce errors. I guess I neeed to also test if the plane is AI or player controlled since I don't need to send a screen message to the AI.
__________________
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; 10-18-2012 at 09:32 AM.
Reply With Quote
  #2  
Old 11-15-2011, 08:28 AM
FG28_Kodiak FG28_Kodiak is offline
Approved Member
 
Join Date: Dec 2009
Location: Swabia->Bavaria->Germany
Posts: 884
Default

You can use the Player(int placeindex) member of the AiAircraft Class:

For example
GamePlay.gpLogServer(new Player[] { (actor as AiAircraft).Player(0) }, " Test ", null);

You should test the null value, if null no human player (Ai).

To send the message to all possible players in an Aircraft:
Code:
for (int i = 0; i < aircraft.Places(); i++)
            if (aircraft.Player(i) != null)
                GamePlay.gpLogServer(new Player[] {aircraft.Player(i)}, " Test ", null);

Last edited by FG28_Kodiak; 11-15-2011 at 08:33 AM.
Reply With Quote
  #3  
Old 11-15-2011, 08:30 AM
salmo salmo is offline
Approved Member
 
Join Date: Mar 2011
Posts: 632
Default

Thankyou for your quick reply Kodiak
__________________
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
Reply With Quote
  #4  
Old 11-23-2011, 08:17 AM
Smokeynz Smokeynz is offline
Approved Member
 
Join Date: Apr 2011
Posts: 106
Default

C# allows for many methods, Kodiak always seems to come up with nice examples

I am using this method with success, it is from the collection of samples from this forum.
What is nice is different msg's to team and plane type.

Code:
 public override void OnPlaceEnter(Player player, AiActor actor, int placeIndex)
    {
        base.OnPlaceEnter(player, actor, placeIndex);
        AiAircraft aircraft = actor as AiAircraft; 
        
        if (aircraft != null)
        switch (aircraft.Army())
        {                
            case 1:
                if (aircraft.Type() == AircraftType.Bomber)
                { GamePlay.gpHUDLogCenter(new Player[] { player},"Red Bomber, Bomb it all, hitler caput"); }
                else { GamePlay.gpHUDLogCenter(new Player[] { player }, "Red Fighter, fight them all"); }
                break;
            case 2:
                if (aircraft.Type() == AircraftType.Bomber)
                { GamePlay.gpHUDLogCenter(new Player[] { player }, "Das bomber!"); }
                else { GamePlay.gpHUDLogCenter(new Player[] { player }, "Das jager!"); }
                break;

        }
    }
Reply With Quote
Reply


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:27 PM.


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