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

[CSGO] A way to close an opened buy menu


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Despirator
Senior Member
Join Date: Jun 2011
Location: Kazakhstan ->Shymkent
Old 05-22-2016 , 07:27   [CSGO] A way to close an opened buy menu
Reply With Quote #1

Hello all!
Is there a way to close already opened buy menu through sourcemod?

I have the code below to close menu but it will not work if cvar mp_buy_everywhere is enabled
If someone is needed in it

PHP Code:
#include <sourcemod>
#include <sdkhooks>

public OnPluginStart()
{
    
AddCommandListener(Command_OpenBuyMenu"open_buymenu");
    
AddCommandListener(Command_CloseBuyMenu"close_buymenu");
}

public 
Action:Command_OpenBuyMenu(client, const String:command[], argc)
{
    
SDKHook(clientSDKHook_PostThinkOnThink);
    
    return 
Plugin_Continue;
}

public 
Action:Command_CloseBuyMenu(client, const String:command[], argc)
{
    
SDKUnhook(clientSDKHook_PostThinkOnThink);
    
    return 
Plugin_Continue;
}

public 
OnThink(client)
{
    
SetEntProp(clientProp_Send"m_bInBuyZone"false1);

Neither forcing player to execute command "close_buymenu" through native ClientCommand nor preventing command "open_buymenu" is working

Last edited by Despirator; 05-22-2016 at 12:47.
Despirator is offline
KissLick
Veteran Member
Join Date: Nov 2012
Location: void
Old 05-22-2016 , 07:36   Re: [CSGO] A way to close an opened buy menu
Reply With Quote #2

Took me like 10 seconds to find this... https://sm.alliedmods.net/new-api/me...ncelClientMenu

(not sure if it works though...)
__________________
Plugins: TeamGames
Includes: Menu stocks, ColorVariables, DownloadTableConfig

> No help through PM, make a topic.
KissLick is offline
Despirator
Senior Member
Join Date: Jun 2011
Location: Kazakhstan ->Shymkent
Old 05-22-2016 , 11:07   Re: [CSGO] A way to close an opened buy menu
Reply With Quote #3

Quote:
Originally Posted by KissLick View Post
Took me like 10 seconds to find this... https://sm.alliedmods.net/new-api/me...ncelClientMenu

(not sure if it works though...)
It's for closing menu like radio and valve style menu not buy menu
Despirator is offline
shanapu
Veteran Member
Join Date: Apr 2015
Location: .de
Old 05-22-2016 , 11:32   Re: [CSGO] A way to close an opened buy menu
Reply With Quote #4

Quote:
Originally Posted by Despirator View Post
It's for closing menu like radio and valve style menu not buy menu
and it took me like 10 seconds to find this... https://wiki.alliedmods.net/Menu_API...g_Menu_Handles & this https://wiki.alliedmods.net/Menus_St...uAction_Cancel

(not sure if it works though...)

maybe also take a look here https://forums.alliedmods.net/showthread.php?t=281898
__________________
coding & free software
shanapu is offline
Addicted.
AlliedModders Donor
Join Date: Dec 2013
Location: 0xA9D0DC
Old 05-22-2016 , 12:37   Re: [CSGO] A way to close an opened buy menu
Reply With Quote #5

He's talking about the CS:GO Buy Menu...
Addicted. is offline
Despirator
Senior Member
Join Date: Jun 2011
Location: Kazakhstan ->Shymkent
Old 05-22-2016 , 12:48   Re: [CSGO] A way to close an opened buy menu
Reply With Quote #6

Quote:
Originally Posted by oaaron99 View Post
He's talking about the CS:GO Buy Menu...
seems to be difficult to understand for them....
Posted a working version in the first post but still searching for another way

Last edited by Despirator; 05-22-2016 at 12:49.
Despirator is offline
DJ Tsunami
DJ Post Spammer
Join Date: Feb 2008
Location: The Netherlands
Old 05-22-2016 , 13:37   Re: [CSGO] A way to close an opened buy menu
Reply With Quote #7

It's suggested here that you can hide the buy menu in CS:S with:
Code:
ShowVGUIPanel(client, "buymenu", _, false);
No idea if that still works in CS:GO, or if "buymenu" is even the correct name.
__________________
Advertisements | REST in Pawn - HTTP client for JSON REST APIs
Please do not PM me with questions. Post in the plugin thread.
DJ Tsunami is offline
shanapu
Veteran Member
Join Date: Apr 2015
Location: .de
Old 05-22-2016 , 17:44   Re: [CSGO] A way to close an opened buy menu
Reply With Quote #8

Quote:
Originally Posted by oaaron99 View Post
He's talking about the CS:GO Buy Menu...
Quote:
Originally Posted by Despirator View Post
seems to be difficult to understand for them....
Posted a working version in the first post but still searching for another way
im really sorry!

i thought about sourcemod menu, my fault. bad day
__________________
coding & free software
shanapu is offline
8guawong
AlliedModders Donor
Join Date: Dec 2013
Location: BlackMarke7
Old 12-12-2017 , 22:44   Re: [CSGO] A way to close an opened buy menu
Reply With Quote #9

Quote:
Originally Posted by DJ Tsunami View Post
It's suggested here that you can hide the buy menu in CS:S with:
Code:
ShowVGUIPanel(client, "buymenu", _, false);
No idea if that still works in CS:GO, or if "buymenu" is even the correct name.
tried this but doesn't work...

tried the original post's solution but don't really like the result

is there any other way to close the buy menu?

---------------- EDIT ----------------

ShowVGUIPanel(client, "buy", _, false);

this works
__________________

Last edited by 8guawong; 12-13-2017 at 05:26.
8guawong 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 18:43.


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