Thirdperson bug

Can you please tell me how to fix a bug with a third person (a third person to go through walls on the map) in this script?

CreateClientConVar("thirdpersona", "0", true, false, "", 0, 1)

function GM:CalcView( ply, pos, angles, fov )
	local view = {
		origin = pos - ( (angles:Forward() * 100) ),
		angles = angles,
		fov = fov,
		drawviewer = true
	}		
	

	if (GetConVarNumber("thirdpersona") == 1 ) then
		return view
	end


end 

function GM:Move(ply, mv)

	if (input.WasKeyPressed(KEY_T)) then 
		RunConsoleCommand("thirdpersona", "1")
	end

	if (input.WasKeyPressed(KEY_T) and GetConVarNumber("thirdpersona") == 1 ) then
		RunConsoleCommand("thirdpersona", "0")		
	end

end

glad I could help