GetPlayerFacingAngle
From SA-MP Wiki
Description:
Gets the angle a player is facing.
(playerid, &Float:ang)
playerid | The player you want to get the angle of. |
&Float:ang | The Float to store the angle in, passed by reference. |
Return Values:
- 1: The function executed successfully.
- 0: The function failed to execute. This means the player does not exist.
- The player's angle is stored in the specified variable.
Note | Angles returned when inside a vehicle is rarely correct. To get the correct facing angle while inside a vehicle, use GetVehicleZAngle. |
Example Usage:
new Float:Angle, string[26]; GetPlayerFacingAngle(playerid, Angle); format(string, sizeof(string), "Your facing angle: %0.2f", Angle); SendClientMessage(playerid, 0xFFFFFFFF, string);
Related Functions
The following functions may be useful, as they are related to this function in one way or another.
- GetVehicleZAngle: Check the current angle of a vehicle.
- SetPlayerFacingAngle: Set a player's facing angle.