//////////////////////////////////////////////////////////////////////////////////
//
//	Connecting Team Fix
//		- Version 1.0
//		- 11.04.2007
//		- diamond-optic
//
//////////////////////////////////////////////////////////////////////////////////
//
// Information:
//
//	connecting clients should now show as
//	spectators instead of appearing on a team.
//
//////////////////////////////////////////////////////////////////////////////////
//
// Change Log:
//
//	- 11.04.07 - Version 1.0
//		Pulled Connecting Team Fix out of DoD Block Exploits
//
//////////////////////////////////////////////////////////////////////////////////

//includes
#include <amxmodx>

//version info
#define VERSION "1.0"

//msgid variable
new g_msgPTeam

public plugin_init()
{
	register_plugin("Connecting Team Fix",VERSION,"diamond-optic")
	register_cvar("amx_connteamfix",VERSION,FCVAR_SERVER|FCVAR_SPONLY)
	
	g_msgPTeam = get_user_msgid("PTeam")
}

///////////////////////////////////////////////////////////////////
// Client Connect -> connecting team fix
//
public client_connect(id)
{
	if((is_user_connecting(id) || is_user_connected(id)) && !is_user_bot(id))
		{
		message_begin(MSG_BROADCAST,g_msgPTeam,{0,0,0})
		write_byte(id)
		write_byte(3)
		message_end()
		}
}