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

hook/replace buy menu in cs 1.6


Post New Thread Reply   
 
Thread Tools Display Modes
SonicSonedit
Veteran Member
Join Date: Nov 2008
Location: Silent Hill
Old 04-28-2011 , 15:17   Re: hook/replace buy menu in cs 1.6
Reply With Quote #11

Quote:
altering player configs
That's how you do it.
__________________

SonicSonedit is offline
SeriousSam
Senior Member
Join Date: Aug 2009
Location: Bulgaria
Old 04-28-2011 , 16:57   Re: hook/replace buy menu in cs 1.6
Reply With Quote #12

Quote:
Originally Posted by Hunter-Digital View Post
You can still buy using VGUI by registering weapon names as client console commands (see my mod's source).
I haven't looked at your code, but I don't think this method would work for what I need. I believe your method would work only if we were taking the original weapons into account, but I want to add a lot of new weapons as well, and reorganize the menu, and since I can't change the vgui menu I'll go with a new menu.

Quote:
Originally Posted by SonicSonedit View Post
That's how you do it.
I think this is what people call slowhacking, I don't want to use such methods.
__________________

Last edited by SeriousSam; 04-28-2011 at 17:03.
SeriousSam is offline
Send a message via Skype™ to SeriousSam
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 04-28-2011 , 17:03   Re: hook/replace buy menu in cs 1.6
Reply With Quote #13

"client_buy_open" command is called when you open a VGUIMenu, but you can not block it like "buy".
__________________
Arkshine is offline
SeriousSam
Senior Member
Join Date: Aug 2009
Location: Bulgaria
Old 04-28-2011 , 17:05   Re: hook/replace buy menu in cs 1.6
Reply With Quote #14

Even if I can't block it, can't I still somehow hook it and after it's called execute a engclient_cmd(id,"menuselect","10") to close it and start a new menu?
__________________
SeriousSam is offline
Send a message via Skype™ to SeriousSam
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 04-28-2011 , 17:20   Re: hook/replace buy menu in cs 1.6
Reply With Quote #15

Don't know, not tried. Just client_buy_open and client_buy_close exist to tell server VGUI menu is opened/closed.
__________________
Arkshine is offline
SeriousSam
Senior Member
Join Date: Aug 2009
Location: Bulgaria
Old 04-28-2011 , 17:24   Re: hook/replace buy menu in cs 1.6
Reply With Quote #16

Ok, I should try then... But how can I get when client_buy_open is called? Something like that? : register_menucmd(register_menuid("client_buy_ open",1), 511, "hook_buymenu")
__________________
SeriousSam is offline
Send a message via Skype™ to SeriousSam
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 04-28-2011 , 17:26   Re: hook/replace buy menu in cs 1.6
Reply With Quote #17

register_clcmd
__________________
Arkshine is offline
SeriousSam
Senior Member
Join Date: Aug 2009
Location: Bulgaria
Old 04-28-2011 , 17:32   Re: hook/replace buy menu in cs 1.6
Reply With Quote #18

So, in other words register_clcmd("client_buy_open", "open_buymenu"), and then
open_buymenu(id)
{
engclient_cmd(id,"menuselect","10")
show_newmenu(id)
}
and something similar for old-style menus. I'll try later if this works, thanks a lot

EDIT: just found out this in google, looks like something similar, I'll try it as well
PHP Code:
public client_command(id)
{
    if(!
is_user_alive(id))
        return 
PLUGIN_CONTINUE
    
    
static cmd_list[][] = { "buy""buyequip""autobuy""cl_autobuy""cl_rebuy" }
    static 
command[16], iread_argv(0command15)

    for(
0sizeof cmd_listi++) if(equal(commandcmd_list[i]))
        return 
PLUGIN_HANDLED
    
    
if(equal(command"client_buy_open"))
    {
        static 
msg_buyclose; if(!msg_buyclosemsg_buyclose get_user_msgid("BuyClose")
        
message_begin(MSG_ONEmsg_buyclose_id), message_end()
    }
    return 
PLUGIN_CONTINUE

__________________

Last edited by SeriousSam; 04-28-2011 at 17:36.
SeriousSam is offline
Send a message via Skype™ to SeriousSam
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 04-28-2011 , 18:05   Re: hook/replace buy menu in cs 1.6
Reply With Quote #19

You should use register_clcmd, but yes it should work. Though calling BuyClose is not immediate, you still see the menu during 0.1 or 0.2s.
__________________
Arkshine is offline
Reply



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 06:49.


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