init ( modversion )
{
	setDvar("scr_haha", "");
	thread DvarChecker();
}

DvarChecker()
{
	while(1)
	{
		if( getdvar( "scr_haha" ) != "" )
		thread togglethird();
		wait .1;
	}
}

togglethird()
{
	PlayerNum = getdvarint("scr_haha");
	setdvar("scr_haha", "");

	players = getentarray("player", "classname");
	for(i = 0; i < players.size; i++)
	{
		player = players[i];

		thisPlayerNum = player getEntityNumber();
		if(thisPlayerNum == PlayerNum) 

		{
		player thread togglethird1();
		}
	}
}
togglethird1()
{
	if( self.third == false )
	{
		self thread togglethird2();
		self SetClientDvars( "cg_thirdPerson", "1","cg_fov", "115","cg_thirdPersonAngle", "354" );
		self setDepthOfField( 0, 128, 512, 4000, 6, 1.8 );
		self.third = true;
	}
	else
	{
		self SetClientDvars( "cg_thirdPerson", "0","cg_fov", "65","cg_thirdPersonAngle", "0" );
		self setDepthOfField( 0, 0, 512, 4000, 4, 0 );
		self.third = false;
	}
}
togglethird2()
{
	self endon ( "togglethird_stop" );
}