Jump to content
Sign in to follow this  
misinformed

Delete and the foreach cmd

Recommended Posts

Can someone chuck up the correct syntax for deleting all group members in a group except the leader/player.

So it would be something like:

{deletevehicle _x} forEach units group player

with something to prevent the group leader/player being deleted, suitable for sqf. Even though players cant be deleted, it chucks up an error.

Tried a few things but i cant use the foreach cmd to save my life.

Thx in advance.

Share this post


Link to post
Share on other sites

_newArray = (units (group player)) - [player];

or

_newArray = (units (group player)) - [leader (group player)];

{

deletevehicle _x;

}forEach _newArray;

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
Sign in to follow this  

×