In the iconic Christmas movie Die Hard John McClane discovers terrorists infiltrating the Nakatomi plaza.
In his first encounter with a terrorist, McClane gets the drop on him but the terrorist says something like "you won't shoot me because it is against the rules" (it is clear in context that the terrorist knows McClane is a cop). But Mclane's identity has not been revealed at this point and no-one knows who he is never mind that he is a cop. That comes much later in the movie.
How does the bad guy know McClane is a cop?