Home   Help Search Login Register  

Author Topic: Checking if a pilot is in his airplane  (Read 473 times)

0 Members and 1 Guest are viewing this topic.

Offline madmedic

  • Members
  • *
  • You can run.....But you'll just die tired.
Checking if a pilot is in his airplane
« on: 15 Feb 2005, 23:28:00 »
I need to write a line in a script that checks if a pilot is actually IN an airplane, and checks if he is NOT in an airplane...and then activate the scripts I have written for both situations.

I intend to make him wear his helmet only while in the airplane, and take it off when he is not.
But I dont know what lines to write that will actually check that.
The rest of the script I have figured out. (I can remove his helmet by triggering the script)

Im guessing it will have to loop, so that it knows when he gets out of the plane.

Any ideas?

Offline Tyger

  • Former Staff
  • ****
  • I was at OFPEC when it still had dirt floors...
    • OFPEC
Re:Checking if a pilot is in his airplane
« Reply #1 on: 15 Feb 2005, 23:37:05 »
to see if unit loon_1 is in the airplane cessna_1, you would enter the code in a trigger as follows:

Code: [Select]
(loon_1 in cessna_1)
and to see if loon_1 is not in cessna_1:

Code: [Select]
!(loon_1 in cessna_1) or
Code: [Select]
not (loon_1 in cessna_1)
that simple  ;D
"People sleep soundly at night only because rough men stand ready to do violence on their behalf." - George Orwell

MSG Mike Everret - We Will Never Forget - '75-'08

Offline madmedic

  • Members
  • *
  • You can run.....But you'll just die tired.
Re:Checking if a pilot is in his airplane
« Reply #2 on: 15 Feb 2005, 23:48:44 »
to see if unit loon_1 is in the airplane cessna_1, you would enter the code in a trigger as follows:

Code: [Select]
(loon_1 in cessna_1)
and to see if loon_1 is not in cessna_1:

Code: [Select]
!(loon_1 in cessna_1) or
Code: [Select]
not (loon_1 in cessna_1)
that simple  ;D

What I want to do is put a script in my pilots PBO that will activate with the "init" in his config, checking to see if he is in ANY plane.

I was hoping to make it where nothing has to be done in init line in the editor, and the planes dont have to be named in the editor.

Would I be able to use a variation of what you wrote ...inside a script

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:Checking if a pilot is in his airplane
« Reply #3 on: 16 Feb 2005, 00:05:17 »
It would be something like

? typeOf vehicle pilot == "air" : consequence

Not guaranteed at all.    Maybe its countType rather than typeOf.   Any maybe its not air but plane, but hopefully you get the idea.
Plenty of reviewed ArmA missions for you to play

Offline Fragorl

  • Coding Team
  • Former Staff
  • ****
Re:Checking if a pilot is in his airplane
« Reply #4 on: 16 Feb 2005, 01:13:18 »
"Air" counttype [vehicle pilot]  == 1 . Or maybe "air" and  [vehicle pilot] round the other way.
One or the other  ;D