Jump to content

Aircraft condition alter


Jacques

Recommended Posts

Hello,

I'm trying to create a code that alter the condition of the aircraft when a pirep is been submitted.

it looks to the landing rate, so when the landing rate is below 200 than 0.5% off the condition.

when a landing rate is higher than 200 than 2% of condition. when a landing rate is higher than 500 than 50% off condition.

so far i have:

$pos = find_in_fsacars_log('TouchDown:Rate', $log);

$landingrate = str_replace('TouchDown:Rate', '', $log[$pos]);

$count = preg_match('/([0-9]*:[0-9]*).*([-+]\d*).*/i', $landingrate, $matches);

if($count > 0)

{

PIREPData::editPIREPFields($report->pirepid, array('landingrate' => $matches[2]));

}

PIREPData::AppendToLog($report->pirepid, $_GET['log']);

if ($count < -200)

{

aircraftdata::editaircraftfields($report->pirepid, array('cond' => $matches[100-0,5]))

}

if ($count > -200)

{

aircraftdata::editaircraftfields($report->pirepid, array('cond' => $matches[100-2]))

}

if ($count > -500)

{

aircraftdata::editaircraftfields($report->pirepid, array('cond' => $matches[100-50]))

}

the most is from the fsacars config file

could anyone help me with this?

thanx!

grtz, Jacques

Link to comment
Share on other sites

  • 3 months later...

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