This sample script made for fun disables player controls. Maybe someone can use it to disable AI controls for say 10 minutes before destroying AI
Code:
using System;
using maddox.game;
using maddox.game.world;
public class Mission: maddox.game.AMission
{
/ / Override the method that is invoked when some of the planes will take off ...
public override void OnAircraftTookOff (int missionNumber, string shortName, AiAircraft aircraft)
{
base.OnAircraftTookOff (missionNumber, shortName, aircraft); / / call the base method (you never know ...)
if (GamePlay.gpPlayer ()! = null) / / check if we have a player.
{
if (GamePlay.gpPlayer (). Place ()! = null) / / check that the player is sitting somewhere and not hanging out on the rag.
{
if (aircraft.Name (). Equals (GamePlay.gpPlayer (). Place (). Name ())) / / if the plane took off - a player, then ...
{
aircraft.hitNamed (part.NamedDamageTypes.ControlsElevatorDisabled); / / ... disables elevators ...
aircraft.hitNamed (part.NamedDamageTypes.ControlsAileronsDisabled); / / ... aileron ...
aircraft.hitNamed (part.NamedDamageTypes.ControlsRudderDisabled); / / ... rudder.
/ / Have a nice flight!
}
}
}
}
}
More scripts here
http://translate.google.com/translat...hp%3Ft%3D68369