Created
December 6, 2017 18:57
-
-
Save bosoy/f4b097a99517319941f12e87e6d6b9e1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
File: BD_fnc_formatarraybaseParent.sqf | |
Author: Dimon UA | |
Description: | |
formatting array of classes on basic parent sign | |
Parameter(s): | |
_this: array of classes | |
Returns: | |
Array - formatted array of classes on basic parent sign | |
["TU_Mi8_AMTSh_RU_D","TU_Mi8_AMTSh_UPK23_RU_D","TU_Mi8_AMTSh_S5_RU_D","TU_UH60L_MED"] call BD_fnc_formatarraybaseParent; | |
[["TU_Mi8_AMTSh_RU_D","TU_Mi8_AMTSh_UPK23_RU_D","TU_Mi8_AMTSh_S5_RU_D"],["TU_UH60L_MED"]] | |
*/ | |
private ["_massive","_veh","_parent_x"]; | |
_massive=[]; | |
{ | |
_veh = _x; | |
_parent_x = ""; | |
_parent_x =[_veh,true] call fn_returnbaseParents; | |
if ({if (_parent_x == ([(_x select 0),true] call fn_returnbaseParents)) exitwith {1}} count (_massive) == 0) then | |
{ | |
_massive set [count _massive, [_veh]] | |
}else{ | |
{ | |
if (_parent_x == ([(_x select 0),true] call fn_returnbaseParents)) exitwith | |
{ | |
(_massive select _foreachindex) set [count (_massive select _foreachindex),_veh] | |
}; | |
} foreach _massive; | |
}; | |
} foreach _this; | |
_massive |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment