Lynxgtr 10 Posted September 12, 2015 Howdy Well, I started making a dialog with the task to shorten the time it takes for players to equip for a mission. So basically I created alot of loadouts via the inbuilt virtual arsenal, but now I my knowledge of scripting reaches it's limit. How do I get the loadouts to be shown in the RscListbox? Share this post Link to post Share on other sites
HallyG 239 Posted September 12, 2015 lbAdd and lbData might help. Have a look at the other related commands on that page too. This might help to get you started: private [ "_ctrl", "_loadouts","_index"]; _ctrl = YOUR LISTBOX CONTROL; _loadouts = [["Basic Rifleman","brifleman"],["Automatic Rifleman","arifleman"]]; // Multi-dimensional Array of Loadouts. Format [[DISPLAYNAME,CLASSNAME],[DISPLAYNAME,CLASSNAME]] { _index = _ctrl lbAdd (_x select 0); _ctrl lbSetData [_index, _x select 1]; } forEach _loadouts; _ctrl lbSetCurSel 0; // Selects the first item in the listbox. You can access the classname assigned to an index of the listbox, maybe after a button is pressed, by using lbData. For example, following from the above example: _sIndex = lbCurSel _ctrl; // returns selected index _data = _ctrl lbData _sIndex; // returns the "classname" of the selected loadout _data call MyLoadoutFunc // Or something like this Haven't tested the above but it should set you on the road to achieving what you asked. 1 Share this post Link to post Share on other sites
Lynxgtr 10 Posted September 12, 2015 Thank you, it works like a charm. :) Share this post Link to post Share on other sites