current_user_can Not Always Working Properly

Do not set header in a template file. Those are part of the HTTP request itself.

About your problem:

Add a template (whatever file you need – see “Template Hierarchy”). On top of it you include the default stuff like get_header(); and so on. For the restricted part, you use the following:

if ( current_user_can( 'view_players_area' ) )
{
    // Code that you want to show to logged in users
    // with a capability of `view_players_area`
}
else
{
    # @link http://queryposts.com/function/wp_login_form/
    wp_login_form();
}