23.05.2014, 18:47
How can i get that is the player west,east,south or north to the target player
A | B | | --------i------- | | C | D
new Float:p[3]; GetPlayerPos(playerid, p[0], p[1], p[2]); if(p[0] > 0.0 && p[1] < 0.0) //the player is in area A else if(p[0] > 0.0 && p[1] > 0.0) //the player is in area B else if(p[0] < 0.0 && p[1] < 0.0) //the player is in area C else if(p[0] < 0.0 && p[1] > 0.0) //the player is in area D
new Angle; GetPlayerFacingAngle(playerid, Angle);
if(Angle< 45 || Angle> 315) print("North");
if(Angle> 225 && Angle< 315) print("West");
if(Angle> 135 && Angle< 225) print("South");
if(Angle> 45 && Angle< 135) print("East");