Home   Help Search Login Register  

Author Topic: SOLVED: Need to find out who is in a heli  (Read 1333 times)

0 Members and 1 Guest are viewing this topic.

Offline Nixer6

  • Members
  • *
SOLVED: Need to find out who is in a heli
« on: 13 Jul 2007, 05:47:51 »
I am working on a script that is basically a  AI driven MH6 "taxi" back to the front for respawned units.

I have everything working pretty good except I neeed a way to determine exactly which and how many units are riding in cargo as passengers in the heli, irrelevant of their group.

It's an .sqf and I have a trigger that detects the respawned guys and joins them into the heli pilots group. The trouble is, after the script starts, others may respawn and jump on the heli, and the script won't know they are in the heli to disembark them and then they join the main group.

Any help would be greatly appreciated.
« Last Edit: 13 Jul 2007, 22:33:30 by Nixer6 »
Why do I have to be a Rocket Scientist to make a good mission?

Offline LCD

  • Former Staff
  • ****
    • Everon Cartel
Re: Need to find out who is in a heli
« Reply #1 on: 13 Jul 2007, 06:24:03 »
it sounds like a crew command tingy... it shud give u how meny units nd who r in da choper... but ull have 2 work it up from dere


LCD OUT
"guess being the community has downsides .." - cheetah
Help Perfecting Da Next Best Thing - O-Team Beta

Offline SniperUK

  • Members
  • *
  • I'm a llama!
Re: Need to find out who is in a heli
« Reply #2 on: 13 Jul 2007, 15:00:37 »
i would have thought a loop using the empty positions command would have been better :
_freePositions = heli emptyPositions "cargo"

Description: Returns the number of free positions of the vehicle.

Positions can be "Commander", "Driver", "Gunner" or "Cargo"

Offline LCD

  • Former Staff
  • ****
    • Everon Cartel
Re: Need to find out who is in a heli
« Reply #3 on: 13 Jul 2007, 20:01:02 »
yeah... but it wont give gim da ppl dat r inside da choper

LCD OUT
"guess being the community has downsides .." - cheetah
Help Perfecting Da Next Best Thing - O-Team Beta

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: Need to find out who is in a heli
« Reply #4 on: 13 Jul 2007, 20:17:34 »
For any vehicle:
Code: [Select]
_vehicle = _this select 0
_passengers = (crew _vehicle) - [driver _vehicle, gunner _vehicle, commander _vehicle]
?(count _passengers) == 0: hint "No passengers here";exit
hint format["%1 passengers here:\n %2", (count _passengers), _passengers]

Offline Nixer6

  • Members
  • *
Re: Need to find out who is in a heli
« Reply #5 on: 13 Jul 2007, 22:31:00 »
Thanks gents.   :clap:

I didn't even know the crew command existed.  :shhh:

« Last Edit: 13 Jul 2007, 22:32:53 by Nixer6 »
Why do I have to be a Rocket Scientist to make a good mission?