Official Fulqrum Publishing forum

Official Fulqrum Publishing forum (http://forum.fulqrumpublishing.com/index.php)
-   FMB, Mission & Campaign builder Discussions (http://forum.fulqrumpublishing.com/forumdisplay.php?f=203)
-   -   How to get plane ID? (http://forum.fulqrumpublishing.com/showthread.php?t=27278)

salmo 10-21-2011 02:52 AM

How to get plane ID?
 
Can someone supply the C# code to get the players airplane ID/serial no please.

[edit] I think I found it. Something like ...

String acName = aircraft.InternalTypeName(); // Plane (Bf109E, etc)
String callSign = aircraft.CallSign(); // Plane ID

FG28_Kodiak 10-21-2011 04:03 AM

(actor as AiAircraft).TypedName() shows tactical Number of plane.

Ataros 10-21-2011 09:32 AM

Quote:

Originally Posted by FG28_Kodiak (Post 352173)
(actor as AiAircraft).TypedName() shows tactical Number of plane.

What would be the difference with (actor as AiAircraft).Name() ?

FG28_Kodiak 10-21-2011 11:02 AM

Name is the actor name ingame.
TypedName is only the tactical number.

Example:
Code:

    public override void OnPlaceEnter(Player player, AiActor actor, int placeIndex)
    {
        base.OnPlaceEnter(player, actor, placeIndex);
        GamePlay.gpLogServer(null, "Name: {0}", new object[] { (actor as AiAircraft).Name() });
        GamePlay.gpLogServer(null, "TypedName: {0}", new object[] { (actor as AiAircraft).TypedName() });
    }

Result:
Name: 0:BoB_LW_LG2_I.000
TypedName: 1 +

If the player use his own number, you will get this number.

Ataros 10-21-2011 02:27 PM

Thank you very much!


All times are GMT. The time now is 09:48 PM.

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