i have played this,its very good.
and i have a better idea to cut trees.
I determine whether the specified XY coordinates are in front of the player.
I'm not careful. Maybe it's not accurate.
public IsPlayerFacingPosition(pid, Float
, Float:y, Float:ag)
{
new Float:_pPos[3];
GetPlayerPos(pid, _pPos[0], _pPos[1], _pPos[2]);
new Float:dlX = x - _pPos[0];
new Float:dlY = y - _pPos[1];
new Float:angle = atan(dlY / dlX);
if(dlX > 0){
angle = angle + 180;
}else{
if(dlY < 0){
angle = 360 - angle;
}
}
angle+=90.0;
new Float
Angle;
GetPlayerFacingAngle(pid, pAngle);
if(floatabs(pAngle - angle) < ag){
return true;
}else{
return false;
}
}