![]() |
|
#18
|
|||
|
|||
|
You can check if a player is already in a plane
Code:
public override void OnPlaceEnter(Player player, AiActor actor, int placeIndex)
{
base.OnPlaceEnter(player, actor, placeIndex);
int playercount = 0;
if (actor != null && actor is AiAircraft)
{
AiAircraft aircraft = actor as AiAircraft;
for (int i = 0; i < aircraft.Places(); i++)
{
if (aircraft.Player(i) != null)
{
if (aircraft.Player(i) == player) playercount++;
}
}
}
if (playercount == 1) ..
}
or you check PlaceSecondary, PlaceSecondary is -1 if a player is 'new' in a plane, if not new PlaceSecondary gets the value of the last secondary place. Code:
if (player.PlaceSecondary() != -1)
..
Last edited by FG28_Kodiak; 05-20-2012 at 07:42 PM. |
|
|