Jump to content

Automatic Fuel Calculation


hjhjhgjgjh

Recommended Posts

Okay, finally the script is running like it should...

Instructions:

1. Put the fuel.tpl file into your /core/templates/ folder.

2. Put this line somewhere into your schedules_briefing.tpl: <?php include('fuel.tpl'); ?>

3. Customize the fuel.tpl file. I used the aircraft name which you can see in your adminpanel under "Airline Operations" -> "Add & Edit Fleet" -> "Name/Type". Just change my existing fleet in the fuel.tpl with your fleet and delete what you dont need. This requires some knowledge of php. (Just watch the code until you notice how it works ;) Also, i included automatic extra fuel for mid/long range flights. You can edit the values in line 165 and 166 in fuel.tpl

If you do not understand it, i will help you.

/remark: If you are using a beta version or in any way, some version have the timeformat "HH:MM" for the flighttime. I am using "HH.MM". If you use HH:MM, you have to change line 158 in the fuel.tpl from

        $fltime = explode(".", $schedule->flighttime);

to

        $fltime = explode(":", $schedule->flighttime);

Here is a screenshot

fuel.png

fuelscript.zip

  • Like 2
Link to comment
Share on other sites

no, you can edit those values also. so the code starts like this:

<?php

        /**

*Fuelflow Table

*/

        $fuelflowMD11 = 7500;

        $fuelflowMD11F = 7500;

to add an aircraft, just put the random value like for a b737-800 you can put $fuelflowB738 or something. then = and then how much it burns per hour. then also to reservers so it would look like

        $reservesB738 = 1000;

and later you have to add this "B738" to those lines

        elseif($schedule->aircraft == 'B737-800') <- there you see the actual name of the aircraft in your list.. you have to put it in manually as well

        {

        $fuelflow = $fuelflowB738;

            $reserves = $reservesB738;

        }

and then its done. well, its not easy to explain, if you want i can edit it for you. or maybe someone can make some panel for it...

Link to comment
Share on other sites

  • 1 month later...
  • 2 months later...
  • 1 month later...

Hi, try to move the sentence into this lines

<td width="50%" >

<?php include ('fuel.tpl'); ?>

</td>

<td width="50%" >

<?php

if($schedule->flighttype=='P')

Also have in mind every time when you upgrade the version (Example ver 930 to 931) the file schedule_briefing.tpl will be replaced for a new one, in my case i have the file in the skin folder located on lib folder.

That is working for me.

Regards

Link to comment
Share on other sites

Nope neither work when i put this

<td width="50%" >

<?php include ('fuel.tpl'); ?>

</td>

<td width="50%" >

<?php

if($schedule->flighttype=='P')

a error comes cant remember what it said but it stops you getting on the schedule briefing and the Template::Show('fuel.tpl') just comes up as

Template::Show('fuel.tpl') in the required fuel bit.

Link to comment
Share on other sites

Nope neither work when i put this

<td width="50%" >

<?php include ('fuel.tpl'); ?>

</td>

<td width="50%" >

<?php

if($schedule->flighttype=='P')

a error comes cant remember what it said but it stops you getting on the schedule briefing and the Template::Show('fuel.tpl') just comes up as

Template::Show('fuel.tpl') in the required fuel bit.

please post the error so i can try to figure out whats the problem

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...