(2021-02-26, 11:55 PM)Virsenas Wrote: https://www.burgershot.gg/showthread.php...3#pid10013I know the function was not created by you, but still ...
You will have to edit the function so you have to enter the x, y and z coordinates instead of playerid (faceplayerid).
Wtf, is all this stuff done with floatsub, floatadd and such. None of that is needed as atan2 already takes into account the sign of both arguments in order to determine the quadrant.
This is all that's needed:
PHP Code:
PlayerFacePosition(playerid, Float:x, Float:y)
{
new Float:px, Float:py, Float:pz;
GetPlayerPos(playerid, px, py, pz);
new Float:angle = atan2(y - py, x - px);
SetPlayerFacingAngle(playerid, angle - 90.0);
}
Always keep in mind that a lot of people are active on this forum in their spare time.
They are sacrificing time they could easily spend on things they would rather do, to help you instead.