So I'm creating a menu, and when I'm creating options and setting data for it, the spawnScript is not grabbing the data properly.
Code:
_main = _tree tvAdd[[], "Main Menu"];
_option = _tree tvAdd[[_main], "Player ESP"];
_tree tvSetData [[_option], "command_playerESP"];
So as you can see, it's making a new dropdown and adding the player esp option. When that's double clicked it should call/spawn the command_playerESP script, but no, it's calling/spawning the 1st option in my 2nd dropdown. Which is the command_ATMMenu:
Code:
_altis = _tree tvAdd[[], "Altis Menu"];
_option = _tree tvAdd[[_altis], "ATM Menu"];
_tree tvSetData [[_option], "command_ATMMenu"];
The issue is it's not grabbing the data properly. It's grabbing the 2nd dropdown, 1st option when it should be getting its own.
Code:
spawnScript = {
_fnc_scriptName = if (isnil "_fnc_scriptName") then {"Functions Init"} else {_fnc_scriptName};
_ctrl = _this;
_curSelArr = tvCurSel _ctrl;
_truepath = [_curSelArr select 0];
_data = _ctrl tvData _truepath;
if (_data == "command_playerESP") then {
[] spawn command_playerESP;
};
};
Why is it doing this?
- - - Updated - - -
@invisionhf @Jme @NeonSabre123 @Extasy_hosting @gladtwoown @Lystic @SuperNeutron