PDA

View Full Version : How to get plane ID?


salmo
10-21-2011, 02:52 AM
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
(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:

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!