{"name":"onGroupIconClick","title":"onGroupIconClick","type":"command","url":"https://community.bistudio.com/wiki/onGroupIconClick","revid":321243,"updated":"2022-05-13T18:19:21Z","groups":["High Command","Event Handlers"],"status":"ok","games":{"arma2":"1.00","arma2oa":"1.50","tkoh":"1.00","arma3":"0.50"},"since":"arma2 1.00","arma3_since":"0.50","description":"Defines an action performed when player clicked on group marker (3D or in a map). The code executed once.\nThis EH, unlike onGroupIconOverEnter and onGroupIconOverLeave, has one more param which returns 1 if RMB was pressed, 0 otherwise.\n\n> [!NOTE]\n> **Arma 3:** Since Arma 3 v1.58 a Mission Event Handler exists and should be used.","syntaxes":[{"syntax":"onGroupIconClick command","params":[{"name":"command","type":"String or Code","description":"script","type_expr":"String | Code"}],"returns":{"type":"Nothing","type_expr":"Nothing"},"form":"unary","right":{"text":"command"}}],"examples":[{"text":"```sqf\nonGroupIconClick\n{\n    // passed values for _this are:\n    params [\"_is3D\", \"_group\", \"_wpID\", \"_posX\", \"_posY\", \"_shift\", \"_ctrl\", \"_alt\"];\n\n    // before Arma 3\n    _is3D = _this select 0;\n    _group = _this select 1;\n    _wpID = _this select 2;\n    _RMB = _this select 3;\n    _posx = _this select 4;\n    _posy = _this select 5;\n    _shift = _this select 6;\n    _ctrl = _this select 7;\n    _alt = _this select 8;\n\n    _message = format [\"____ Info ____\"];\n    {_message = _message + format [\"\\n %1\", _x]} forEach _this;\n    hint _message;\n};\n```","code":["onGroupIconClick\n{\n\t// passed values for _this are:\n\tparams [\"_is3D\", \"_group\", \"_wpID\", \"_posX\", \"_posY\", \"_shift\", \"_ctrl\", \"_alt\"];\n\n\t// before Arma 3\n\t_is3D = _this select 0;\n\t_group = _this select 1;\n\t_wpID = _this select 2;\n\t_RMB = _this select 3;\n\t_posx = _this select 4;\n\t_posy = _this select 5;\n\t_shift = _this select 6;\n\t_ctrl = _this select 7;\n\t_alt = _this select 8;\n\n\t_message = format [\"____ Info ____\"];\n\t{_message = _message + format [\"\\n %1\", _x]} forEach _this;\n\thint _message;\n};"]}],"see_also":["addGroupIcon","clearGroupIcons","getGroupIcon","getGroupIconParams","groupIconSelectable","groupIconsVisible","removeGroupIcon","setGroupIcon","setGroupIconParams","setGroupIconsSelectable","setGroupIconsVisible","onGroupIconOverEnter","onGroupIconOverLeave"]}