getPedCameraRotation | Multi Theft Auto: Wiki Skip to content

getPedCameraRotation

Client-side
Server-side
Shared

Pair: setPedCameraRotation

This page is incomplete! Help wanted!

Please finish this page using the corresponding Old Wiki article.
Go to Contribution guidelines for more information.


This function gets the current camera rotation of a ped.

Note

The camera rotation angle returned by this function is 360º - α (where α is the actual camera rotation angle). See example to know how to deal with this.

Syntax

getPedCameraRotation ( )

Code Examples

client

This example creates a/getrotationcommand which outputs the expected camera rotation of the player which types it.

addCommandHandler( "getrotation",
function ()
local rot = 360 - getPedCameraRotation(localPlayer) -- Also fix the camera rotation
outputChatBox("Your camera rotation is " .. rot .. "º", 0, 225, 0)
end
)

See Also