zbug 160 Posted September 27, 2015 This sounds so simple it hurts, yet I wasn't able to find any answer or hint anywhere You've got 3 dudes in your squad: number 1, number 2, number 3. In the group units array, number 1 is at index 0, number 2 is at index 1, number 3 is at index 2. Everything's good, I can easily retrieve the actual number by doing array index + 1. However, something bad happens to number 2, so now you've got 2 dudes in your squad: number 1, number 3. In the group units array, number 1 is at index 0, number 3 is at index 1, so I can't retrieve the number based on the array indexes anymore. Yet the UI keeps displaying the correct squad numbers so the info must be somewhere. Any idea? Thanks! Share this post Link to post Share on other sites
terox 316 Posted September 27, 2015 call this function on the unit fget_UnitNumber.sqf // MP MACHINE : All // Called from : various // Called using : [unit] call ZEU_AD_fget_UnitNumber // Description : Returns the Unit's group number as seen in the command gui // removes the first 2 elements from that array and then recompiles as a string ///////////////////////////////////////////////////// ///// PRELIMS ///// ///////////////////////////////////////////////////// private["_u"]; _u = _this select 0; parseNumber(([[str _u, count(toArray(str group _u))+1] call BIS_fnc_trimString, " "] call BIS_fnc_splitString) select 0) 1 Share this post Link to post Share on other sites
killzone_kid 1331 Posted September 27, 2015 joinAs page has an example of how to do that https://community.bistudio.com/wiki/joinAs 1 Share this post Link to post Share on other sites
cuel 25 Posted September 28, 2015 What are you trying to do that requires that you know their index? Share this post Link to post Share on other sites
zbug 160 Posted September 28, 2015 Thanks for the answers! What are you trying to do that requires that you know their index? Spotting the squad members with map markers, and a simple squad management UI. Everything works except the numbers that were wrong, until now ;) Share this post Link to post Share on other sites
terox 316 Posted September 28, 2015 Thats what I use it for too 1 Share this post Link to post Share on other sites