I try to use this code to add a magazine when double click on a magazine in inventory :
[] spawn { test_fnc_test = { _idc = ctrlIDC (_this select 0); _selectedIndex = _this select 1; _unit = player; _item = lbData [_idc, _selectedIndex]; if (_item isEqualTo "30Rnd_556x45_Stanag") then { player removePrimaryWeaponItem "30Rnd_556x45_Stanag"; player addPrimaryWeaponItem "30Rnd_556x45_Stanag"; }; }; while {true} do { waituntil {!(isnull (finddisplay 602))}; ((findDisplay 602) displayCtrl 638) ctrlSetEventHandler ["LBDblClick", "_this call test_fnc_test"]; waituntil {isnull (finddisplay 602)}; }; };
And the first time, I try, it's work. But when I retry (close inventory and reopen) >> Game Crash
But when I use "LBSelChanged" instead of "LBDblClick", it's works fine.