I'm trying to block the team menu with the following code:
HTML Code:
public plugin_init()
{
...
register_message(get_user_msgid("ShowMenu"), "event_TeamMenu")
register_message(get_user_msgid("VGUIMenu"), "event_TeamMenu_VGUI")
}
...
public event_TeamMenu_VGUI(iMsgid, iDest, id)
{
if(get_pcvar_num(g_cvar_teams_blocks)!=1)
return PLUGIN_CONTINUE
new iMenu_id=get_msg_arg_int(1)
if(iMenu_id!=2)
return PLUGIN_CONTINUE
client_cmd(id, "jointeam 6")
return PLUGIN_HANDLED
}
public event_TeamMenu(iMsgid, iDest, id)
{
if(get_pcvar_num(g_cvar_teams_blocks)!=1)
return PLUGIN_CONTINUE
static iText_Menu[50]
get_msg_arg_string(4, iText_Menu, charsmax(iText_Menu))
if(!equal(iText_Menu, "#Team_Select") && !equal(iText_Menu, "#Team_Select_Spect"))
return PLUGIN_CONTINUE
client_cmd(id, "jointeam 6")
return PLUGIN_HANDLED
}
I want to send the player to the SPECT if cvar is active, but then when the player will play, the player's hud is in error, there is another way to send the player to SPECT without the error?