Jump to content
Sign in to follow this  
1para{god-father}

List of all Playable Groups

Recommended Posts

you mean groups which consist of Players?

try this:

_PlayableGroups = [];

{
if (isPlayer (leader _x)) then 
{
 _PlayableGroups = _PlayableGroups + [_x]
};
} forEach allGroups

Edited by mantls
change a variable to avoid confusion

Share this post


Link to post
Share on other sites
{
    //Code
} foreach playableunits;

Is this what you are talking about?

Not exactly, he asked for all groups, not all players.

You can use allGroups like mantls, or if you want to use playableunits:

private ["_group","_playableGroups"];
_playableGroups = [];
{
 _group = group _x;
 if !(_group in _playableGroups) then {
   _playableGroups set [count _playableGroups,_group];
 }
} foreach playableunits;

Share this post


Link to post
Share on other sites

I only just saw this thread - I have had this around for a little while and am surprised at how close it was to Shuko's code.....

I just call the function when each player JIP and at start of mission in the init.sqf

 BluForGroups=[];IndiGroups=[];OpforGroups=[];

fnc_GetGroups = {

       {
       if ((side _x == opfor) && !( group _x in OpforGroups)) then {OpforGroups set [count OpforGroups,  group _x]};
       if ((side _x == independent) && !( group _x in IndiGroups)) then {IndiGroups set [count IndiGroups,  group _x]};
       if ((side _x == blufor) && !( group _x in BluForGroups) ) then {BluForGroups set [count BluForGroups, group _x]};
        } foreach (playableunits + switchableunits);
   };

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  

×