Hi! I tried to bind !guns-command on G (drop weapon). If menu closed, press G open menu. If menu open, then G close menu. All working, but menu closing only after 5 seconds after pressing G. Any ideas how to fix?
I used DeathMatch plugin by Maximou5.
My code:
PHP Code:
public Action Cmd_Drop(int client, const char[] command, int argc) {
if(GetClientMenu(client) != MenuSource_None ){
FakeClientCommand(client, "menuselect 9");
FakeClientCommand(client, "say trollolollolol");}
else
DisplayOptionsMenu(client);
return Plugin_Handled;
}
Code by plugin:
PHP Code:
void DisplayOptionsMenu(int client)
{
int allowSameWeapons = (g_bRememberChoice[client]) ? ITEMDRAW_DEFAULT : ITEMDRAW_DISABLED;
Menu menu = new Menu(MenuHandler);
menu.SetTitle("Weapon Menu:");
menu.AddItem("New", "New weapons");
menu.AddItem("Same", "Same weapons", allowSameWeapons);
menu.AddItem("Random", "Random weapons");
menu.ExitBackButton = false;
menu.Display(client, MENU_TIME_FOREVER);
}