Check if a player is behind a player
#9

Quote:
Originally Posted by Kitten
View Post
Yeah misread the topic anyways this should do it,

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;
}
Wouldnt this work if the player is in front of someone and facing them aswell



Quote:
Originally Posted by Grand_Micha
View Post
...you didn't even bother with the link, did you? Just open the page, look at "Returning multiple values". You do not even have to be familiar with trigonometry, just copy and paste and experiment until you get the hang of it.
You are not even telling me how the function works
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)