AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [Help!] Jointeam VGUI/OLD style menus (https://forums.alliedmods.net/showthread.php?t=144301)

MaT' 12-01-2010 20:13

[Help!] Jointeam VGUI/OLD style menus
 
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 ?

Sylwester 12-02-2010 01:32

Re: [Help!] Jointeam VGUI/OLD style menus
 
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



ConnorMcLeod 12-02-2010 01:35

Re: [Help!] Jointeam VGUI/OLD style menus
 
Quote:

Originally Posted by Sylwester (Post 1361280)
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

Sylwester 12-02-2010 02:09

Re: [Help!] Jointeam VGUI/OLD style menus
 
It works, so explain why is it wrong?

hleV 12-02-2010 06:52

Re: [Help!] Jointeam VGUI/OLD style menus
 
Quote:

Originally Posted by Sylwester (Post 1361290)
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.

Sylwester 12-02-2010 10:48

Re: [Help!] Jointeam VGUI/OLD style menus
 
Ahh, I misunderstood the problem, though you still can use it to block default menu and then show your own.

ConnorMcLeod 12-02-2010 12:03

Re: [Help!] Jointeam VGUI/OLD style menus
 
Also your way wouldn't catch all menus.


All times are GMT -4. The time now is 11:23.

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