OMG I am sorry, i forgot that lol.
pawn Код:
forwad Float:SetPlayerToFacePos(playerid, Float:X, Float:Y);
public Float:SetPlayerToFacePos(playerid, Float:X, Float:Y)
{
new
Float:local_pX,
Float:local_pY,
Float:local_pZ,
Float:ang;
GetPlayerPos(playerid, local_pX, local_pY, local_pZ);
if( Y > local_pY ) ang = (-acos((X - local_pX) / floatsqroot((X - local_pX)*(X - local_pX) + (Y - local_pY)*(Y - local_pY))) - 90.0);
else if( Y < local_pY && X < local_pX ) ang = (acos((X - local_pX) / floatsqroot((X - local_pX)*(X - local_pX) + (Y - local_pY)*(Y - local_pY))) - 450.0);
else if( Y < local_pY ) ang = (acos((X - local_pX) / floatsqroot((X - local_pX)*(X - local_pX) + (Y - local_pY)*(Y - local_pY))) - 90.0);
if(X > local_pX) ang = (floatabs(floatabs(ang) + 180.0));
else ang = (floatabs(ang) - 180.0);
ang += 180.0;
SetPlayerFacingAngle(playerid, ang);
return ang;
}