Hello,
My server mod is GunGame (respawn).
I use this to hook all possible team menus (I know that only 2-3 of them are usable in case of not using VIP, but just to be sure):
Code:
register_menucmd(register_menuid("#IG_Team_Select_Spect", true), MENU_KEY_1|MENU_KEY_2|MENU_KEY_5|MENU_KEY_6, "select_team_old");
register_menucmd(register_menuid("#Team_Select_Spect", true), MENU_KEY_1|MENU_KEY_2|MENU_KEY_5|MENU_KEY_6|MENU_KEY_0, "select_team_old");
register_menucmd(register_menuid("#IG_Team_Select", true), MENU_KEY_1|MENU_KEY_2|MENU_KEY_5|MENU_KEY_0, "select_team_old");
register_menucmd(register_menuid("#IG_VIP_Team_Select", true), MENU_KEY_1|MENU_KEY_2|MENU_KEY_3|MENU_KEY_5|MENU_KEY_6|MENU_KEY_0, "select_team_old");
register_menucmd(register_menuid("#IG_VIP_Team_Select_Spect", true), MENU_KEY_1|MENU_KEY_2|MENU_KEY_5|MENU_KEY_0, "select_team_old");
I use this in order to implement some team checks before joining a team. If the chosen option (team) doesn't match my requirements, the command is blocked (return PLUGIN_HANDLED), an informative message appears, and the menu shows up again (engclient_cmd(id, "chooseteam"))
The problem is that in some cases (let's say 1 / 10), the menu appears, the key is pressed (1, 2, 5, 6 - doesn't matter)
but the function isn't called.
Under what circumstances the function ("select_team_old") is not hooked to the menu ?
Thank you!
LE: I remember that I've done some tests some time ago and the problem doesn't exist if the server is empty (me being the only player).