OFPEC Forum

Editors Depot - Mission Editing and Scripting => ArmA - Editing/Scripting General => Topic started by: Nixer6 on 13 Jul 2007, 05:47:51

Title: SOLVED: Need to find out who is in a heli
Post by: Nixer6 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.
Title: Re: Need to find out who is in a heli
Post by: LCD on 13 Jul 2007, 06:24:03
it sounds like a crew (http://www.ofpec.com/COMREF/index.php?action=list&game=All&letter=c#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
Title: Re: Need to find out who is in a heli
Post by: SniperUK 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"
Title: Re: Need to find out who is in a heli
Post by: LCD on 13 Jul 2007, 20:01:02
yeah... but it wont give gim da ppl dat r inside da choper

LCD OUT
Title: Re: Need to find out who is in a heli
Post by: Mandoble 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]
Title: Re: Need to find out who is in a heli
Post by: Nixer6 on 13 Jul 2007, 22:31:00
Thanks gents.   :clap:

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