{"name":"showCommandingMenu","operator":null,"title":"showCommandingMenu","type":"command","url":"https://community.bistudio.com/wiki/showCommandingMenu","revid":363591,"updated":"2024-04-07T18:31:09Z","groups":["Interaction"],"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":"Create the commanding menu described by the given config class or menu name. When the name is empty, the current menu is hidden.\n\nIf commanding menu has \"expression\" set up, the expression will receive the following arguments when user activated the menu item:\n- Local variable `_target`: Object - Target under the cursor. This works in both 3D and 2D (when cursor is over the unit icon on the map).\n- Local variable `_pos`: Array - Cursor position.\n- Local variable `_is3D`: Boolean - false if cursor is over the map, otherwise true.","syntaxes":[{"syntax":"showCommandingMenu name","since":null,"effect":null,"exec":null,"params":[{"name":"name","type":"String","optional":false,"default":null,"description":"class name or user menu name (with \"#USER:\" prefix and \"_#\" page number suffix, where # is the page number starting with 0).","types":["String"],"since":null,"text":"name: String - class name or user menu name (with \"#USER:\" prefix and \"_#\" page number suffix, where # is the page number starting with 0)."}],"returns":{"type":"Nothing","types":["Nothing"],"description":null,"text":"Nothing"},"form":"unary","operator":null,"left":null,"right":{"text":"name","types":["String"]}}],"examples":[{"text":"```sqf\nshowCommandingMenu \"\";\n```","code":["showCommandingMenu \"\";"]},{"text":"```sqf\nshowCommandingMenu \"MyClassName\";\n```","code":["showCommandingMenu \"MyClassName\";"]},{"text":"```sqf\nshowCommandingMenu \"#USER:Tag_Menu_myMenu_0\";\n```","code":["showCommandingMenu \"#USER:Tag_Menu_myMenu_0\";"]},{"text":"```sqf\nshowCommandingMenu \"RscMainMenu\";\n```","code":["showCommandingMenu \"RscMainMenu\";"]}],"multiplayer":null,"problems":null,"aliases":[],"see_also":["commandingMenu","Arma 3: Communication Menu","BIS_fnc_createMenu"],"notes":[{"user":"LaKing","date":"2010-01-25T17:20:00Z","text":"```sqf\n// This script will create a custom menu, and display it once.\n\nMY_SUBMENU_inCommunication =\n[\n    [\"User submenu\", true],\n    [\"Option-1\", [2], \"\", -5, [[\"expression\", \"player sidechat \"\"-1\"\" \"]], \"0\", \"0\", \"\\ca\\ui\\data\\cursor_support_ca\"],\n    [\"Option 0\", [3], \"\", -5, [[\"expression\", \"player sidechat \"\" 0\"\" \"]], \"1\", \"0\", \"\\ca\\ui\\data\\cursor_support_ca\"],\n    [\"Option 1\", [4], \"\", -5, [[\"expression\", \"player sidechat \"\" 1\"\" \"]], \"1\", \"CursorOnGround\", \"\\ca\\ui\\data\\cursor_support_ca\"]\n];\n\nMY_MENU_inCommunication =\n[\n    // First array: \"User menu\" This will be displayed under the menu, bool value: has Input Focus or not.\n    // Note that as to version Template:arma2 1.05, if the bool value set to false, Custom Icons will not be displayed.\n    [\"User menu\", false],\n\n    // Syntax and semantics for following array elements:\n    // [\"Title_in_menu\", [assigned_key], \"Submenu_name\", CMD, [[\"expression\",script-string]], \"isVisible\", \"isActive\" <, optional icon path>]\n    // Title_in_menu: string that will be displayed for the player\n    // Assigned_key: 0 - no key, 1 - escape key, 2 - key-1, 3 - key-2, ... , 10 - key-9, 11 - key-0, 12 and up... the whole keyboard\n    // Submenu_name: User menu name string (eg \"#USER:MY_SUBMENU_NAME\" ), \"\" for script to execute.\n    // CMD: (for main menu:) CMD_SEPARATOR -1; CMD_NOTHING -2; CMD_HIDE_MENU -3; CMD_BACK -4; (for custom menu:) CMD_EXECUTE -5\n    // script-string: command to be executed on activation. (no arguments passed)\n    // isVisible - Boolean 1 or 0 for yes or no, - or optional argument string, eg: \"CursorOnGround\"\n    // isActive - Boolean 1 or 0 for yes or no - if item is not active, it appears gray.\n    // optional icon path: The path to the texture of the cursor, that should be used on this menuitem.\n    [\"First\", [0], \"\", -5, [[\"expression\", \"player sidechat \"\"First\"\" \"]], \"1\", \"1\"],\n    [\"Second\", [2], \"\", -5, [[\"expression\", \"player sidechat \"\"Second\"\" \"]], \"1\", \"1\"],\n    [\"Submenu\", [3], \"#USER:MY_SUBMENU_inCommunication\", -5, [[\"expression\", \"player sidechat \"\"Submenu\"\" \"]], \"1\", \"1\"]\n];\n\nshowCommandingMenu \"#USER:MY_MENU_inCommunication\";\n```\n\nAppendix, list of optional argument strings:\n- `AmmoLow`\n- `AreActions`\n- `CanAnswer`\n- `CanDeselectTeamFromBar`\n- `CanDeselectUnitFromBar`\n- `CanDeselectVehicleFromBar`\n- `CanSelectTeamFromBar`\n- `CanSelectUnitFromBar`\n- `CanSelectVehicleFromBar`\n- `CommandsToGunner`\n- `CommandsToPilot`\n- `CursorOnEmptyVehicle`\n- `CursorOnEnemy`\n- `CursorOnFriendly`\n- `CursorOnGround`\n- `CursorOnGroupMember`\n- `CursorOnGroupMemberSelected`\n- `CursorOnHoldingFire`\n- `CursorOnNeedFirstAID`\n- `CursorOnNeedHeal`\n- `CursorOnNotEmptySubgroups`\n- `CursorOnVehicleCanGetIn`\n- `FormationDiamond`\n- `FormationLine`\n- `FuelLow`\n- `HasRadio`\n- `HCCanDeselectTeamFromBar`\n- `HCCanDeselectUnitFromBar`\n- `HCCanSelectTeamFromBar`\n- `HCCanSelectUnitFromBar`\n- `HCCursorOnIcon`\n- `HCCursorOnIconenemy`\n- `HCCursorOnIconSelectable`\n- `HCCursorOnIconSelectableSelected`\n- `HCIsLeader`\n- `HCNotEmpty`\n- `Injured`\n- `IsAlone`\n- `IsAloneInVehicle`\n- `IsCommander`\n- `IsLeader`\n- `IsSelectedToAdd`\n- `IsTeamSwitch`\n- `IsWatchCommanded`\n- `IsXbox`\n- `Multiplayer`\n- `NotEmpty`\n- `NotEmptyBlueTeam`\n- `NotEmptyCommanders`\n- `NotEmptyGreenTeam`\n- `NotEmptyInVehicle`\n- `NotEmptyMainTeam`\n- `NotEmptyRedTeam`\n- `NotEmptySoldiers`\n- `NotEmptySubgroups`\n- `NotEmptyYellowTeam`\n- `PlayableLeader`\n- `PlayableSelected`\n- `PlayerOwnRadio`\n- `PlayerVehicleCanGetIn`\n- `SelectedTeam`\n- `SelectedUnit`\n- `SomeSelectedHaveTarget`\n- `SomeSelectedHoldingFire`\n- `VehicleCommander`"},{"user":"SilentSpike","date":"2016-07-23T15:40:00Z","text":"You can combine the argument strings (see the above note) together to create OR conditions.\n\nHence `\"HasRadioIsLeader\"` is true when the unit is a leader or has a radio."}],"categories":["Arma 2: New Scripting Commands","Arma 2: Operation Arrowhead: Scripting Commands","Arma 2: Scripting Commands","Arma 3: Scripting Commands","Command Group: Interaction","Introduced with Arma 2 version 1.00","Scripting Commands","Take On Helicopters: Scripting Commands"]}