Well from BF1942, I've come into not being able to tell friend from foe. Initially I'd just shoot.... take names later.. which norally would say "GakFace Killed a Teammate" and that answers that name....
From there I learned not so much by what they look like, as again sometimes you just won't be able to notice it by clothes alone.. I pay attention to their movements.. where they are facing, where they are going.. what they are doing. Add all this up, and I've been able to figure out who to shoot.
As for real life? The closest I've gotten is Laser Tag. There, you go in not really knowing what your teammates look like.. You grab a few quick glimpses and thats about it. After that you have two reconitions, if they're shooting you and what color their pack is. Since I'm not on an open playing field but on one with with obstructions, I do my best to hide and shoot. I'm also huge on strafing (in and out of game, I strafe like mad). Because of this I'm able to think for a quick second just what i'm seeing then shoot. I tend to hold the gun in firing positition, so its just a matter of recognizing and lining up sites (at the same time). I come out with a hit on the team usually every game. Of course normally if I were to be shooting people, I wouldn't be in a small enclosed area making circles.... so I'd come into contact with teammates MUCH less. Heh I feel like a cop raiding, as I move as if i'm rushing, with my gun either low to the floor moving, or raised eye level for easy aim. On top of that... (Sadly I haven't gone in a while), but I've been called Rambo at the Lazer Arena.
... Having 8 people stalk me because they were sick of me beating them in showdowns (all at the same time.. heh). But I spose thats another story.
Also I should point out that I'm a passive guy... I see no reason why I'll be holding a gun in the first place.. that said.. Before I shoot, I'll be damn sure I'm shooting who I need to shoot.