SetPlayerFacingAngle

From SA-MP Wiki

Jump to: navigation, search


Description:

Set a player's facing angle (Z rotation).


Parameters:
(playerid, Float:ang)
playeridThe ID of the player to set the facing angle of.
Float:angThe angle the player should face.


Return Values:

  • 1: The function executed successfully.
  • 0: The function failed to execute. The player specified does not exist.


Image:32px-Circle-style-warning.png

Important
Note

Angles are reversed in GTA:SA; 90 degrees would be East in the real world, but in GTA:SA 90 degrees is in fact West. North and South are still 0/360 and 180. To convert this, simply do 360 - angle.


Example Usage:

SetPlayerFacingAngle( playerid, 0 ); //Player faces north

        north (0)
           |
(90) west-   -east (270)      (Good way to remember: Never Eat Shredded Wheat)
           |
        south (180)

Related Functions

The following functions may be useful, as they are related to this function in one way or another.

Personal tools
In other languages