• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Pawn] [Solved] Set player facing angle to the object
#6
PHP Code:
stock SetPlayerFacingAngleToObject(playeridobjectid)

{

    new 
Float:x1Float:y1Float:z1;

    new 
Float:x2Float:y2Float:z2;

    

    
GetPlayerPos(playeridx1y1z1);

    
GetObjectPos(objectidx2y2z2);

    

    new 
Float:angle atan2(y2 y1x2 x1) - 90.0;

    

    
SetPlayerFacingAngle(playeridangle);


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

Forum Jump: