Raised This Month: $ Target: $400
 0% 

The VGUI hates me - register_menucmd woes


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
VVildo
New Member
Join Date: Jun 2004
Old 06-14-2004 , 00:12   The VGUI hates me - register_menucmd woes
Reply With Quote #1

Hi all,

I just got into scripting and I'm trying to do some stuff when someone tries to buy an AWP/autosniper (basically customize SuicideDog's Drop AWP with Team Limit and Win limit 0.4 to my likings). What I have no works perfectly fine with the Old-style menus, but doesn't do anything when I have the VGUI enabled. This really irks me because I'm basically just copy/pasting code. Can anyone tell what I'm doing wrong?

Here's the plugin_init:
Code:
public plugin_init(){     register_plugin("MYTEST","0.05","CherryRain")     register_menucmd(-31,(1<<4),"menu_awp")     register_menucmd(-31,(1<<5),"menu_awp")     register_menucmd(register_menuid("BuyRifle", 1),(1<<4),"menu_awp")     register_menucmd(register_menuid("BuyRifle", 1),(1<<5),"menu_awp")     register_clcmd("drop","handle_drop")     register_cvar("awplimit","0")     return PLUGIN_CONTINUE }

and then the menu_awp function:
Code:
public menu_awp(id,key) {     if (get_cvar_num("awplimit")!=1) return PLUGIN_CONTINUE     new team = get_user_team(id)     client_print(id,print_chat,"[CR]: Team=%d ID=%d Key=%d", team, id, key)     client_print(id,print_chat,"[CR]: NO GUN FOR YOU")     client_cmd(id,"slot1;wait;wait;wait;drop")         return PLUGIN_CONTINUE }

From what I can gather the register_menuid() function is what makes the old-style menus work (and those actually work ). The register_menucmd lines say which menu (-31 is the menu for rifles right?) and which button (1<<4 is option 5 and 1<<5 is option 6) for the VGUI menus.

One thing I don't understand is the difference between 'return PLUGIN_CONTINUE' and 'return PLUGIN_HANDLED'...is this the source of my problem?

I'm terribly sorry for having my first post be a question, but this has stumped me all night.
VVildo is offline
 



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


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