Jump to content
Sign in to follow this  
taltsinth

Detecting if an AI unit has joined the Players Group

Recommended Posts

I'm looking for some help on detecting if an AI unit has joined the player's Group (I.e. Squad).

I currently have the AI unit set to 'C1' and group 'groupContact'.

C1 = groupContact createUnit ["C_man_1", _markerPos, [], 0, "FORM"];

I pull the player's group via

_playerGrp = group player;

What I need is a String Comparison command. I've done some searches on here, Armaholic and Google itself and have had no luck (I imagine due to my lack of understanding of what's needed really). Was hoping someone could point me in the right direction.

I.e. check if C1 is a member of _playerGrp.

Edited by TalTsinth

Share this post


Link to post
Share on other sites

A quick bump and second post to continue this thread as whilst the above work's great in a waitUntil I can't figure out how to use it in an if check. I want to use an if check to determine if C1 is NOT within the player's group within the script and I'm at a loss on how to check that against the player's group. Can anyone point me in the right direction again?

Share this post


Link to post
Share on other sites

not sure if this will work?

if!(C1 in units group player) then
{

};

Share this post


Link to post
Share on other sites
not sure if this will work?

if!(C1 in units group player) then
{

};

Brilliant! I had been putting the ! inside the bracket's like an idiot. Thanks ARJay.

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  

×