30.09.2010, 03:09
I believe someone wrote a filterscript containing a function like IsPlayerLookingAtPlayer(playerid, playerid2). Take a look at the code for that. If it is not around, you will need to read up on finding the angle between two vectors. The first vector being the position vector of the player with the melee weapon, and the second vector being the displacement between the first player and the second player. If you are still having trouble with this, I can post some pseudocode. Hope this helps!