Jump to content
dachs

Checking if player group is in any unnamed vehicle?

Recommended Posts

I want to check if player group is in any unamed (air) vehicle passing a trigger area.

It's to be used for triggering mission ending, when players use a helo to extract.

 

Right now i use this

this && {_x in heli1 && alive _x && isPlayer _x} count playableUnits == {alive _x && isPlayer _x} count playableUnits;

The above in a trigger, with condition BLUFOR Present, works for the vehicle named "heli1".

 

Is there a way to check any kind of vehicle, or maybe class useing isKindOf "air" somehow?

Share this post


Link to post
Share on other sites
this && {((vehicle _x) isKindOf "Air") && alive _x && (_x in thislist)} count allplayers == {alive _x} count allplayers

I changed playableunits (with AI) with allplayers (no AI) so you could drop the "isPlayer" check.

I also added a check, so only player in the trigger area are counted against the overall playercount (means all players must be in air vehicle IN the trigger area).

  • Like 1

Share this post


Link to post
Share on other sites

That got it working, thanks a bunch!

I didn't have much luck with "allPlayers" though, so had to change it back to isPlayer and playableUnits.

 

Hmm, I wonder if this could be the reason?

 

NOTE: In player hosted game, the complete array of allPlayers may get delayed at the start. Use BIS_fnc_listPlayers if you need it earlier

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×