View Single Post
  #8  
Old 05-27-2012, 02:37 PM
FG28_Kodiak FG28_Kodiak is offline
Approved Member
 
Join Date: Dec 2009
Location: Swabia->Bavaria->Germany
Posts: 884
Default

You can use two events:

Code:
 public override void OnAircraftKilled(int missionNumber, string shortName, AiAircraft aircraft)
    {
        base.OnAircraftKilled(missionNumber, shortName, aircraft);
    }
and
Code:
    public override void OnActorDead(int missionNumber, string shortName, AiActor actor, List<DamagerScore> damages)
    {
        base.OnActorDead(missionNumber, shortName, actor, damages);
    }
On OnAircraftKilled is called when a plane is not longer flyable, for example if the pilot get killed or its too heavy damaged, but you get not the damager.

OnActorDead is called later after a plane is hitting the ground or a GroundActor or AiPerson or AiGroup (a Ships is an AiGroup) is killed. And you can check the damagers.

OnActorDestroyed is called every time a Actor is removed from the game, so its also called if a script removed a empty plane. So you should use OnAircraftKilled or OnActorDead.

Last edited by FG28_Kodiak; 05-27-2012 at 02:44 PM.
Reply With Quote