23.06.2012, 22:56
Quote:
That checks if the player is near, not behind.
Probs need to get the angle, and then compare the angle to the other players pos. Shouldn't be too hard. |
pawn Code:
stock IsPlayerBehindPlayer(playerid, targetid, Float:dOffset) {
new Float:playera,Float:playert;
if(!IsPlayerConnected(playerid) || !IsPlayerConnected(targetid)) return 0;
GetPlayerFacingAngle(playerid, playera);
GetPlayerFacingAngle(targetid, playert);
if(AngleInRangeOfAngle(playera, playert, dOffset) && IsPlayerFacingPlayer(playerid, targetid, dOffset)) return true;
return false;
}