Raised This Month: $ Target: $400
 0% 

error to blocking team menu


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
andre neves
Junior Member
Join Date: Mar 2011
Old 08-08-2011 , 08:53   error to blocking team menu
Reply With Quote #1

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?
andre neves 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 03:29.


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