{"name":"onGroupIconClick","operator":null,"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","replaced_by":[],"games":[{"game":"arma2","name":"Arma 2","version":"1.00"},{"game":"arma2oa","name":"Arma 2: Operation Arrowhead","version":"1.50"},{"game":"tkoh","name":"Take On Helicopters","version":"1.00"},{"game":"arma3","name":"Arma 3","version":"0.50"}],"since":{"game":"arma2","name":"Arma 2","version":"1.00"},"arma3_since":"0.50","branch":null,"locality":{"argument":null,"effect":null,"server_exec":false},"exec":null,"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","since":null,"effect":null,"exec":null,"params":[{"name":"command","type":"String or Code","optional":false,"default":null,"description":"script","types":["String","Code"],"since":null,"text":"command: String or Code - script"}],"returns":{"type":"Nothing","types":["Nothing"],"description":null,"text":"Nothing"},"form":"unary","operator":null,"left":null,"right":{"text":"command","types":["String","Code"]}}],"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};"]}],"multiplayer":null,"problems":null,"aliases":[],"see_also":["addGroupIcon","clearGroupIcons","getGroupIcon","getGroupIconParams","groupIconSelectable","groupIconsVisible","removeGroupIcon","setGroupIcon","setGroupIconParams","setGroupIconsSelectable","setGroupIconsVisible","onGroupIconOverEnter","onGroupIconOverLeave"],"notes":[],"categories":["Arma 2: New Scripting Commands","Arma 2: Operation Arrowhead: Scripting Commands","Arma 2: Scripting Commands","Arma 3: Scripting Commands","Command Group: Event Handlers","Command Group: High Command","Introduced with Arma 2 version 1.00","Scripting Commands","Take On Helicopters: Scripting Commands"]}