Raised This Month: $32 Target: $400
 8% 

!guns menu closing after delay


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Zira
New Member
Join Date: Nov 2018
Old 11-14-2018 , 15:37   !guns menu closing after delay
Reply With Quote #1

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[] commandint 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(clientMENU_TIME_FOREVER);


Last edited by Zira; 11-14-2018 at 15:38.
Zira is offline
Dragokas
Veteran Member
Join Date: Nov 2017
Location: Ukraine on fire
Old 11-16-2018 , 02:02   Re: !guns menu closing after delay
Reply With Quote #2

What game?

Maybe it can help:
Code:
CancelClientMenu(client, true, INVALID_HANDLE);
__________________
Expert of CMD/VBS/VB6. Malware analyst. L4D fun (Bloody Witch & FreeZone)
[My plugins] [My tools] [GitHub] [Articles] [HiJackThis+] [Donate]
Dragokas is offline
Zira
New Member
Join Date: Nov 2018
Old 11-16-2018 , 06:36   Re: !guns menu closing after delay
Reply With Quote #3

Quote:
Originally Posted by Dragokas View Post
What game?

Maybe it can help:
Code:
CancelClientMenu(client, true, INVALID_HANDLE);
CS:GO
Nothing change. Still need wait 5 second before menu disappears. Only if i try select some item after pressing G, menu close immediately

Can i create empty (invisible) menu and just replace !guns - menu?

Last edited by Zira; 11-16-2018 at 06:48.
Zira is offline
Zira
New Member
Join Date: Nov 2018
Old 11-16-2018 , 08:24   Re: !guns menu closing after delay
Reply With Quote #4

My solution: create an empty panel, and call it when need to close the menu. As a result, we have a transparent, little almost negligible square, which will close in a second.
PHP Code:
{
    
Panel panel = new Panel();
    
panel.SetTitle("");
    
panel.DrawText("");
    
panel.Send(clientPanelHandler11);
    
delete panel;
    return 
Plugin_Handled;


Last edited by Zira; 11-16-2018 at 08:37.
Zira is offline
Dragokas
Veteran Member
Join Date: Nov 2017
Location: Ukraine on fire
Old 11-16-2018 , 08:26   Re: !guns menu closing after delay
Reply With Quote #5

Nice walkaround, Zira
__________________
Expert of CMD/VBS/VB6. Malware analyst. L4D fun (Bloody Witch & FreeZone)
[My plugins] [My tools] [GitHub] [Articles] [HiJackThis+] [Donate]
Dragokas is offline
Zira
New Member
Join Date: Nov 2018
Old 11-16-2018 , 10:16   Re: !guns menu closing after delay
Reply With Quote #6

and ofc, only after I have found a solution, someone will tell the easier way Just one line:
PHP Code:
InternalShowMenu(client"\10"1); 

Last edited by Zira; 11-16-2018 at 10:16.
Zira is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 20:10.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode