Gerbil Maximus
09-27-2011, 09:12 AM
Hey all,
Been making a test mission for MP, and trying to add any thing that is cool to it.
So far I have the ambulance and airfield vehicles script.
I want Trains but they dont work sadly.
Does anyone else know of any other cool features i could add to my mission?
Also how do i add multiple scripts? I have the above script running but i also want to add the remove non ai aircraft when player leaves script from below:
using System;
using maddox.game;
using maddox.game.world;
using System.Collections.Generic;
public class Mission : AMission
{
public void _DespawnEmptyPlane(AiActor actor)
{
if (actor == null)
{ return;}
Player[] Players = GamePlay.gpRemotePlayers();
bool PlaneIsEmpty = true;
foreach (Player i in Players)
{
if ((i.Place() as AiAircraft) == (actor as AiAircraft))
{
PlaneIsEmpty = false;
break;
}
}
if (PlaneIsEmpty)
{ (actor as AiAircraft).Destroy(); }
}
public override void OnPlaceLeave(Player player, AiActor actor, int placeIndex)
{
base.OnPlaceLeave(player, actor, placeIndex);
Timeout(1, () =>
{
_DespawnEmptyPlane(actor);
});
}
}
Thank you
The Gerbil
Been making a test mission for MP, and trying to add any thing that is cool to it.
So far I have the ambulance and airfield vehicles script.
I want Trains but they dont work sadly.
Does anyone else know of any other cool features i could add to my mission?
Also how do i add multiple scripts? I have the above script running but i also want to add the remove non ai aircraft when player leaves script from below:
using System;
using maddox.game;
using maddox.game.world;
using System.Collections.Generic;
public class Mission : AMission
{
public void _DespawnEmptyPlane(AiActor actor)
{
if (actor == null)
{ return;}
Player[] Players = GamePlay.gpRemotePlayers();
bool PlaneIsEmpty = true;
foreach (Player i in Players)
{
if ((i.Place() as AiAircraft) == (actor as AiAircraft))
{
PlaneIsEmpty = false;
break;
}
}
if (PlaneIsEmpty)
{ (actor as AiAircraft).Destroy(); }
}
public override void OnPlaceLeave(Player player, AiActor actor, int placeIndex)
{
base.OnPlaceLeave(player, actor, placeIndex);
Timeout(1, () =>
{
_DespawnEmptyPlane(actor);
});
}
}
Thank you
The Gerbil