# Selected Subgroup Units

Grammar — Selected subgroup of units for player player
FlagsNative | Function

Returns the selected units subgroup for the specified player.

# Arguments

  • int — Player

Returns — unitgroup

native unitgroup UnitSubgroupSelected(int inPlayer);

Category: Selection / Unit Selection

# Examples

mods/starcoop/starcoop.sc2modbase.sc2data/LibCOMI.galaxy:18378

    UnitCreateEffectUnit(lv_fenixUnitNew, "CopyTargetSelectionAndControlGroups", lv_fenixUnitOld);
    if ((UnitGroupCount(lv_fenixPlayerSelectionGroup, c_unitCountAlive) > 0)) {
        lv_fenixPlayerActivedSubGroup = UnitSubgroupSelected(lv_fenixPlayer);
        lv_selected = UnitIsSelected(lv_fenixUnitOld, lv_fenixPlayer);
        lv_activedSubGroupSelected = UnitGroupHasUnit(lv_fenixPlayerActivedSubGroup, lv_fenixUnitOld);

mods/starcoop/starcoop.sc2modbase.sc2data/LibCOMI.galaxy:25639


    if ((libCOMI_gv_cM_TychusMedicTranportSendViaTopBar[lv_p] == false)) {
        lv_ug = UnitSubgroupSelected(lv_p);
    }
    else {