DisableMenuRow
Description:
Function DisableMenuRow disable a specific row in a menu for all players. It will be greyed-out and can't be selected by players.
|
Parameters:
(menuid, row)
int | menuid | The ID of the menu to disable a row of. Ensure this is valid, as an invalid menu ID will crash the entire server. |
int | row | The ID of the row to disable (rows start at 0). |
Return Values:
This function always returns 1, even if the function fails. If an invalid row is specified, nothing will happen. If an invalid menu ID is specified, the server will crash.
Examples:
new Menu:WeaponMenu; WeaponMenu = CreateMenu("Weapons", 1, 50.0, 180.0, 200.0, 200.0); AddMenuItem(WeaponMenu, 0, "Rocket Launcher"); AddMenuItem(WeaponMenu, 0, "Flamethrower"); AddMenuItem(WeaponMenu, 0, "Minigun"); AddMenuItem(WeaponMenu, 0, "Grenades"); if(!strcmp(cmdtext, "/disablemenu", true)) { DisableMenuRow(WeaponMenu, 2); //Disable the "Minigun" row return 1; }
Related Functions
The following functions may be useful, as they are related to this function in one way or another.
- CreateMenu: Create a menu.
- DestroyMenu: Destroy a menu.
- AddMenuItem: Add an item to a menu.