Is Point right or left from player
#1

How to detect is point left or right from player?


left point < Player Point > right point
(x,y,z) (x,y,z) (x,y,z)

Quote:

IsLForRG(playerid,Float,Float:y,Float:z)
{
new Float:X,Float:Y,Float:Z,Float:Ang;
GetPlayerPos(playerid, X, Y, Z);
GetPlayerFacingAngle(playerid, Ang);
//And now what??

}

Reply
#2

I'm probably miles off as I am on lunch at work without a samp server to test but see if that helps?

Код:
if(ang > 90 && ang < 270){ //player is facing southways
    if(pointx < X) //left in north //right in south
    if(pointx > X) //right in north //Left in South
}
else {//player is facing northways
    if(pointx < X) //left in north //right in south
    if(pointx > X) //right in north //Left in South
}
I didnt have the mind to think about the y axis but works similar i'm sure
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)