Mini Map, track enemies or player as enemy

I have made a mini map watching this video

Now, my problem is I’m totally clueless on having the same character show up as an enemy when played by someone else. Also, to show other characters as an enemy too and vice versa. So far my mini map is the same as the one from the video, but with some tweaks to fit my game.