![]() |
|
|
|
#1
|
|||
|
|||
|
You dont need a player in this case, you get a AiAircraft via OnAircraftCrashLanded. So you don't need a Player. The most of your player code make no sense
corrected: Code:
public override void OnAircraftCrashLanded(int missionNumber, string shortName, AiAircraft aircraft)
{
base.OnAircraftCrashLanded(missionNumber, shortName, aircraft);
switch ((aircraft).InternalTypeName())
{
case "bob:Aircraft.SpitfireMkIIa":
currentSpitIIas--;
allowedSpitIIas -= 1;
break;
case "bob:Aircraft.Bf-109E-4":
currentSpitIIas--; // <---- Attention wrong variable
allowed109s -= 1;
break;
}
List<Player> playersInPlane = new List<Player>();
for (int i = 0; i < aircraft.Places(); i++)
{
if (aircraft.Player(i) != null)
{
playersInPlane.Add(aircraft.Player(i));
}
}
if (playersInPlane.Count > 0)
GamePlay.gpHUDLogCenter(playersInPlane.ToArray(), "Looks like you are walking home...", new object[] { });
Timeout(120, () =>
{ destroyPlane(aircraft); });
}
|
|
#2
|
|||
|
|||
|
Oh. Using PplayersInplane so much neater. thanks kodiak.
__________________
__________________ Win7, 64bit Ultra Asus P8P67Pro MB Intel i7-2600K Coursair 16GB (4x 4GB), DDR3-1600MHz Gainward Nvidia 580GTX 3GB DDR5 850-Watt Modular Power Supply WIN7 and COD on Gskill SSD 240GB 40" Panasonic LCD TrackIR5 + Thrustmaster Warthog stick, throttle & pedals |
![]() |
| Thread Tools | |
| Display Modes | |
|
|