Raised This Month: $ Target: $400
 0% 

[Help!] Jointeam VGUI/OLD style menus


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
MaT'
Junior Member
Join Date: Apr 2010
Old 12-01-2010 , 20:13   [Help!] Jointeam VGUI/OLD style menus
Reply With Quote #1

When player uses VGUI menus, register_clcmd("jointeam 1", "cmdTT") WORKS PERFECT, but when the same player uses OLD style menus, register_clcmd("jointeam 1", "cmdTT") DOESN'T WORK

how do I register to work with OLD style menus ?
MaT' is offline
Sylwester
Veteran Member
Join Date: Oct 2006
Location: Poland
Old 12-02-2010 , 01:32   Re: [Help!] Jointeam VGUI/OLD style menus
Reply With Quote #2

you can do it this way:
PHP Code:
public plugin_init(){
    
register_message(get_user_msgid("ShowMenu"), "message_show_menu")
}

public 
message_show_menu(msgiddestid) {
    new 
tmp[32]
    
get_msg_arg_string(4tmp31)
    if(
contain(tmp"#Team_Select")==0){
        
//join team menu
        //return PLUGIN_HANDLED to block it
    
}else if(contain(tmp"#CT_Select")==|| contain(tmp"#Terrorist_Select")==0){
        
//join class menu
        //return PLUGIN_HANDLED to block it
    
}
    return 
PLUGIN_CONTINUE

__________________
Impossible is Nothing
Sylwester is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 12-02-2010 , 01:35   Re: [Help!] Jointeam VGUI/OLD style menus
Reply With Quote #3

Quote:
Originally Posted by Sylwester View Post
you can do it this way:
PHP Code:
public plugin_init(){
    
register_message(get_user_msgid("ShowMenu"), "message_show_menu")
}

public 
message_show_menu(msgiddestid) {
    new 
tmp[32]
    
get_msg_arg_string(4tmp31)
    if(
contain(tmp"#Team_Select")==0){
        
//join team menu
        //return PLUGIN_HANDLED to block it
    
}else if(contain(tmp"#CT_Select")==|| contain(tmp"#Terrorist_Select")==0){
        
//join class menu
        //return PLUGIN_HANDLED to block it
    
}
    return 
PLUGIN_CONTINUE

Wrong, you have to use register_menu[...]
Something like this : http://forums.alliedmods.net/showpos...81&postcount=2
__________________
- tired and retired -

- my plugins -

Last edited by ConnorMcLeod; 12-02-2010 at 01:40.
ConnorMcLeod is offline
Sylwester
Veteran Member
Join Date: Oct 2006
Location: Poland
Old 12-02-2010 , 02:09   Re: [Help!] Jointeam VGUI/OLD style menus
Reply With Quote #4

It works, so explain why is it wrong?
__________________
Impossible is Nothing
Sylwester is offline
hleV
Veteran Member
Join Date: Mar 2007
Location: Lithuania
Old 12-02-2010 , 06:52   Re: [Help!] Jointeam VGUI/OLD style menus
Reply With Quote #5

Quote:
Originally Posted by Sylwester View Post
It works, so explain why is it wrong?
It's registers the event during which the menu is shown. Not when the item is selected.
__________________
hleV is offline
Sylwester
Veteran Member
Join Date: Oct 2006
Location: Poland
Old 12-02-2010 , 10:48   Re: [Help!] Jointeam VGUI/OLD style menus
Reply With Quote #6

Ahh, I misunderstood the problem, though you still can use it to block default menu and then show your own.
__________________
Impossible is Nothing
Sylwester is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 12-02-2010 , 12:03   Re: [Help!] Jointeam VGUI/OLD style menus
Reply With Quote #7

Also your way wouldn't catch all menus.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod 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 11:23.


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