Jump to content

Aircraft Restrictions


Flightguy123

Recommended Posts

Hi, I know I brought this post up in the past, but I was unable to set it up. The code I had was completely wrong and closed out all the schedules besides AAL001. Does anyone have any other idea on how I can erstrict New Hires from flying like 777's? Like in the real world, new pilots first start small, as there hours get bigger so do the aircraft they can fly.

Thanks

Ada

Link to comment
Share on other sites

Guest lorathon

We restrict by Airline. We have the following

PVX - Phoenix Express - All pilots assigned to this airline are only allowed to bid on and fly PVX flights. The schedule is designed so that all PVX flights are Saab 340 / CRJ-200 / etc...

PVA - Phoenix Airways - Same as above except that the schedules are setup with A320 / 737 / etc...

PVI - Phoenix International - you get the picture

When a pilot searches for a flight my code checks there pilot code (PVX, PVA, PVI) and then determines which to show. A PVX only sees PVX. A PVA sees PVX and PVA. A PVI sees all.

Link to comment
Share on other sites

  • Administrators

You could use something like this inside of your foreach loop in schedule_results.tpl ->

<?php
if(Auth::$userinfo->rank <> 'Senior Captain' && $route->aircraft == 'B777')
{ continue; }
?>

That will tell the loop to continue past any route that has a B777 aircraft unless the user is a Senior Captain. You would have to change "Senior Captain" and "B777" to fit your needs but it would accomplish what you are trying to do I think.

Link to comment
Share on other sites

You could use something like this inside of your foreach loop in schedule_results.tpl ->

<?php
if(Auth::$userinfo->rank <> 'Senior Captain' && $route->aircraft == 'B777')
{ continue; }
?>

That will tell the loop to continue past any route that has a B777 aircraft unless the user is a Senior Captain. You would have to change "Senior Captain" and "B777" to fit your needs but it would accomplish what you are trying to do I think.

roger, um Simpilot how would I go about doing this, what do you mean each loop?

Link to comment
Share on other sites

Guest lorathon

Add it into your schedules_results.tpl

Before the start of the table.

// Filter by airline
if(Auth::$userinfo->code != $route->code)
{
	continue;
}

This above filters by airline code. Whatever filter you want to use stick right before the ?>. The table starts somewhere around line 80.

Link to comment
Share on other sites

  • Administrators

Open up the schedule_results.tpl and find

<?php
foreach($allroutes as $route)
{

and insert the code directly after it so it looks like this ->

<?php
foreach($allroutes as $route)
{
if(Auth::$userinfo->rank <> 'Senior Captain' && $route->aircraft == 'B777')
{ continue; }

  • Like 1
Link to comment
Share on other sites

  • Administrators

Are you logged in when you are trying it? If not the Auth class will be empty. Pastebin your page and post the link and I will take a look at it. Also try a print_r($route) inside the foreach and see if [name] => blah is in the array. I have not tested this so the variable we are looking for may not be there or may be getting written into another variable name.

Link to comment
Share on other sites

  • Administrators

Put a

print_r($route);

inside of the foreach loop for the routes and see what it spits out. Look for a variable in the array that has the acircraft icao code. It is under name in the db but may be getting renamed in the new array.

Link to comment
Share on other sites

  • Administrators

You can wait for this one, I'm implementing aircraft restrictions on ranks for 2.1.

A few things I though I'd present:

  • Do schedules show if they are on an aircraft they're not qualified for? I can add a bit into the template which will skip it (like there are for several cases now). Since schedules can be flown with any aircraft, does it even matter
  • If they file a PIREP, what happens if they used an aircraft they can't fly
  • Do aircraft they can't fly show up on the PIREP form?
  • ACARS flights - if they use an aircraft they're not supposed to - I presume it would notify the admin in the accept screen
  • Statistics - excluding aircraft they can't fly from showing up in the stats screen

Link to comment
Share on other sites

You can wait for this one, I'm implementing aircraft restrictions on ranks for 2.1.

A few things I though I'd present:

  • Do schedules show if they are on an aircraft they're not qualified for? I can add a bit into the template which will skip it (like there are for several cases now). Since schedules can be flown with any aircraft, does it even matter
  • If they file a PIREP, what happens if they used an aircraft they can't fly
  • Do aircraft they can't fly show up on the PIREP form?
  • ACARS flights - if they use an aircraft they're not supposed to - I presume it would notify the admin in the accept screen
  • Statistics - excluding aircraft they can't fly from showing up in the stats screen

yeah wow, this would be great! It would help out A LOT, Simpilot, I added you on my messenger account.. Nabeel, when will this be out??

Thanks

Ada

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