setPedCameraRotation
Client
Changes where a ped's camera faces. On the local player it turns the game camera; on a ped it is the direction it looks and aims.
bool setPedCameraRotation(ped thePed, float rotation)
Parameters
| Name | Type | Description |
|---|---|---|
| thePed | ped | The ped or player. For any element, the function also applies to the elements below it, and the result is the element's own. |
| rotation | float | The rotation in degrees, around the vertical axis. |
Returns
true if the rotation was applied. false if the element is not a ped or player.
Example
local ped = createPed("male01", 2495.0, -1685.0, 13.5)
setPedCameraRotation(ped, 90)
setPedControlState(ped, "aim_weapon", true)