Jump to content
Sign in to follow this  
iceman77

Parsing player names into a list box without the group notations/IDs

Recommended Posts

As you can see, the name in the list box under Alpha contains the group ID aswell. How can I get rid of that? Here's how I'm currently getting the names into the lb .

lbClear 6100; 
_listgroupsunitsA = units Alpha;
_groupSizeA = count(_listgroupsunitsA);
_grouptotalA = _groupSizeA - 1;

For "_i" from 0 to _grouptotalA Do
{
    _index = lbAdd [6100, str (_listgroupsunitsA select _i)]; 
};

newdialog.jpg

Share this post


Link to post
Share on other sites

This should work :

lbClear 6100;
_listgroupsunitsA = units Alpha;
{
   _index = lbAdd [6100, (name _x)];
   _data = lbSetData [6100, _index, _x]; // To access the actual player afterwards use : "_unit = lbData [6100, (lbCurSel 6100)];"
} forEach _listgroupsunitsA;

Share this post


Link to post
Share on other sites

_listgroupsunitsA = units Alpha;
_mynamelist = [];


{


_temp = name _x;
_mynamelist set [count _mynamelist,_temp];
} forEach _listgroupsunitsA;


hint str _mynamelist; 

---------- Post added at 07:12 AM ---------- Previous post was at 07:12 AM ----------

opps... beaten to the punch ^^

Share this post


Link to post
Share on other sites

ICEMAN - i had that fixed already :) - although i couldnt get rid of the strings either side - e.g "mike"

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  

×