Jump to content
Blitzen88

Removing units that are in a vehicle from an array?

Recommended Posts

Good morning,

 

Im trying to figure out how to remove units that are in a vehicle from an array.  I feel like this is probably an easy solution but my little brain cant figure it out.

 

This is what I have:

 

//Define the Group

_PlayersGroup = group player;

 

//Remove the player from the array

_PlayerSquadMates = (units _PlayersGroup - [player]);

 

//Remove units which are in a vehicle:

_PlayerSquadMates = _PlayerSquadMates – Units in a vehicle

 

//Have the filtered units call the function

{ [_x, blah blah blah] spawn Example_fnc_FunctionName } foreach _PlayerSquadMates;

Share this post


Link to post
Share on other sites

private _playerSquadMates = units player select  {!isPlayer _x && isNull objectParent _x};  //not a player, not in a vehicle, even parachute)

 

Share this post


Link to post
Share on other sites

 

1 hour ago, pierremgi said:

private _playerSquadMates = units player select  {!isPlayer _x && isNull objectParent _x};  //not a player, not in a vehicle, even parachute)

 

Does this need to be units group player instead of units player?


Just curious because Im stuck at work and cant test stuff right now. 

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

×