Official Fulqrum Publishing forum

Official Fulqrum Publishing forum (http://forum.fulqrumpublishing.com/index.php)
-   FMB, Mission & Campaign builder Discussions (http://forum.fulqrumpublishing.com/forumdisplay.php?f=203)
-   -   Fuel limit (http://forum.fulqrumpublishing.com/showthread.php?t=32277)

28_Condor 05-21-2012 02:43 AM

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 :)

salmo 05-21-2012 06:03 AM

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
        }
    }
}


28_Condor 05-21-2012 08:04 PM

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%


All times are GMT. The time now is 09:09 AM.

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