• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Pawn] [Solved] Set player facing angle to the object
#6
PHP Code:
stock SetPlayerFacingAngleToObject(playerid, objectid) { new Float:x1, Float:y1, Float:z1; new Float:x2, Float:y2, Float:z2; GetPlayerPos(playerid, x1, y1, z1); GetObjectPos(objectid, x2, y2, z2); new Float:angle = atan2(y2 - y1, x2 - x1) - 90.0; SetPlayerFacingAngle(playerid, angle); }
My nickname in-game is: [L]3O
  Reply


Messages In This Thread
RE: Set player facing angle to the object - by Leonardo - 2021-06-05, 04:50 AM