Fulqrum Publishing Home   |   Register   |   Today Posts   |   Members   |   UserCP   |   Calendar   |   Search   |   FAQ

Go Back   Official Fulqrum Publishing forum > Fulqrum Publishing > IL-2 Sturmovik: Cliffs of Dover > FMB, Mission & Campaign builder Discussions

Reply
 
Thread Tools Display Modes
  #1  
Old 05-21-2012, 02:43 AM
28_Condor 28_Condor is offline
Approved Member
 
Join Date: Oct 2009
Posts: 108
Default Fuel limit

Its possible to build a script to limit fuel for a type of plane? Or better: for plane and respawn in airfiled?


Thanks for any help

Last edited by 28_Condor; 05-21-2012 at 02:45 AM.
Reply With Quote
  #2  
Old 05-21-2012, 06:03 AM
salmo salmo is offline
Approved Member
 
Join Date: Mar 2011
Posts: 632
Default

Fuel limit on spawning

Code:
public override void OnPlaceEnter(Player player, AiActor actor, int placeIndex)
{
     base.OnPlaceEnter(player, actor, placeIndex);

     AiAircraft aircraft = actor as AiAircraft;
     if (aircraft != null)
     {
         double FuelLimit = 100; // max kg's of fuel allowed
         double f = aircraft.getParameter(part.ParameterTypes.S_FuelReserve, -1);  // kg's of fuel in aircraft
         if (f > FuelLimit)  // too much fuel
        {
            aircraft.Destroy();    // too much fuel so destroy plane
        }
     }
}
__________________
When one engine fails on a two engine bomber, you will always have enough power left to get to the scene of the crash.

Get the latest COD Team Fusion patch info HERE

Last edited by salmo; 05-21-2012 at 06:23 AM.
Reply With Quote
  #3  
Old 05-21-2012, 08:04 PM
28_Condor 28_Condor is offline
Approved Member
 
Join Date: Oct 2009
Posts: 108
Default

Thanks, Salmo!

Where I can specify the type of plane? Sorry, I'm newbie with scripts...

I want a limit only for BFs... like in one airfield 100%, in another 20%

Last edited by 28_Condor; 05-21-2012 at 08:12 PM.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 09:23 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright © 2007 Fulqrum Publishing. All rights reserved.