Don't think so, probably just because of the message block.
With this players will auto join Spectator, but then will be free to join a team when they choose. Is that what your after?
Code:
#include <amxmodx>
#include <cstrike>
#define VGUI_SELECT_TEAM 2
public plugin_init()
{
register_plugin( "Force Join Spec", "0.0.1", "hornet" );
register_message( get_user_msgid("ShowMenu"), "Message_ShowMenu" );
register_message( get_user_msgid("VGUIMenu"), "Message_VGUIMenu" );
}
public client_disconnect( id )
{
remove_task( id );
}
public Message_ShowMenu( iMsg, iDest, id )
{
if( cs_get_user_team( id ) != CS_TEAM_UNASSIGNED )
return PLUGIN_CONTINUE;
static MESSAGE[] = "#Team_Select", szMsg[ charsmax( MESSAGE ) ];
get_msg_arg_string( 4, szMsg, charsmax( szMsg ) );
if( equal( szMsg, MESSAGE ) )
{
set_task( 0.1, "task_JoinTeam", id );
return PLUGIN_HANDLED;
}
return PLUGIN_CONTINUE;
}
public Message_VGUIMenu( iMsg, iDest, id )
{
if( get_msg_arg_int( 1 ) != VGUI_SELECT_TEAM || cs_get_user_team( id ) != CS_TEAM_UNASSIGNED )
return PLUGIN_CONTINUE;
set_task( 0.1, "task_JoinTeam", id );
return PLUGIN_HANDLED;
}
public task_JoinTeam( id )
{
cs_set_user_team( id, CS_TEAM_SPECTATOR );
}
__________________