Somewhat like this?
~V~
Addendum 06.11.2019:
Unfortunately the code doesn't work with all <NamedDamageTypes>.
Means the following code doesn't work with Eng0CylinderHeadFire etc.
Sorry ~V~
Code:
using maddox.game;
using maddox.game.world;
using maddox.GP;
public class Mission : AMission {
public override void OnPlaceEnter(Player player, AiActor actor, int placeIndex) {
base.OnPlaceEnter(player, actor, placeIndex);
AiAircraft aircraft = player.Place() as AiAircraft;
GamePlay.gpLogServer(null, aircraft.ToString(), new object [] { });
if (aircraft.Player(0) != null) {
player = aircraft.Player(0);
GamePlay.gpLogServer(null, player.ToString(), new object [] { });
/// Remove the player from the aircraft for a few ms.
/// A workaround to do damage to player aircraft.
player.PlaceLeave(0);
Timeout(0.1, () => {
aircraft.hitNamed(part.NamedDamageTypes.Eng0CylinderHeadFire);
aircraft.hitNamed(part.NamedDamageTypes.Eng0FuelSecondariesFire);
aircraft.hitNamed(part.NamedDamageTypes.Eng0OilSecondariesFire);
player.PlaceEnter(aircraft, 0);
});
}
}
}
Bookmarks