Thread: Planes despawn
View Single Post
  #4  
Old 01-04-2013, 02:11 PM
nilsabc nilsabc is offline
Registered Member
 
Join Date: Jul 2012
Posts: 5
Default

OK i tried it and it didn't work script was marked as ok but in mission nothing happend when plane landed but i think its because i implemented that script into the main mission where no aircraft are placed i tried to get it into te sub mission where the aircrafts get spawned but i have a simple problem there :

I have no other script there and i am lost what do i need to do if i just want the single script
Code:
    public override void OnAircraftLanded(int missionNumber, string shortName, AiAircraft aircraft)
    {
        base.OnAircraftLanded(missionNumber, shortName, aircraft);

        double DespawnAfter = 5 * 60;   // seconds after landing
        Timeout(DespawnAfter, () =>     // despawn after specified seconds
        {
            try { aircraft.Destroy(); }
            catch { }
        });
    }
to work without anything else because i failed to achieve that
Reply With Quote