![]() |
|
#18
|
|||
|
|||
|
Yes that's looking good
I haven't tested your one but it should work. I left in the condition to check for an airfield and added the condition to check for player planes: Code:
public override void OnAircraftLanded(int missionNumber, string shortName, AiAircraft aircraft)
{
base.OnAircraftLanded(missionNumber, shortName, aircraft);
AiAirport NearestAirport = FindNearestAirport(aircraft);
//if (NearestAirport != null)
if ((NearestAirport != null) && (!isAiControlledPlane(aircraft)))
{
PlanesQueue CurPlane = new PlanesQueue(aircraft, NearestAirport, 0);
int ArmyPos = 0;
CurPlane.health = (float)aircraft.getParameter(part.ParameterTypes.M_Health, -1);
if (GamePlay.gpFrontExist())
{
ArmyPos = GamePlay.gpFrontArmy(NearestAirport.Pos().x, NearestAirport.Pos().y);
}
else { ArmyPos = aircraft.Army(); };
if (CurPlane.health < 1f)
{
CurPlane.State |= ServiceType.EMERGENCY;
CurPlane.State |= ServiceType.FIRE;
}
else if (aircraft.Army() == ArmyPos)
{
CurPlane.State |= ServiceType.FUEL;
CurPlane.State |= ServiceType.AMMO;
if (aircraft.Type() == AircraftType.Bomber) CurPlane.State |= ServiceType.BOMBS;
};
if (!(aircraft.Army() == ArmyPos)) CurPlane.State |= ServiceType.PRISONERCAPTURE;
if (!CurPlanesQueue.Contains(CurPlane))
{
CurPlanesQueue.Add(CurPlane);
CheckEmrgCarOnAirport(CurPlanesQueue.Count - 1);
}
else
{
for (int i = 0; i < CurPlanesQueue.Count; i++)
if (CurPlanesQueue[i] == CurPlane)
{
CheckEmrgCarOnAirport(i);
break;
}
}
CurPlane = null;
};
}
If you've got any hints for setting up a repair script, please share I'm hoping that we can get a reference page for scripting commands on a wiki, much like this one: http://community.bistudio.com/wiki/C...Commands_ArmA2 That would be really useful. |
|
|