GetPedCameraRotation

From Multi Theft Auto: Wiki
Jump to navigation Jump to search

Gets the camera rotation of a ped.

Syntax

float getPedCameraRotation( ped thePed )

Required Arguments

  • thePed: the ped to retrieve the camera rotation of.

Returns

Returns the camera rotation of the ped, in degrees: 0 means facing north, higher values go counter clockwise. Returns false if an invalid element was passed.

Example

-- Create a command that outputs the camera rotation of the localPlayer
addCommandHandler( "getrotation", 
    function ()
        local rotation = getPedCameraRotation( localPlayer )
        outputChatBox( "Your camera rotation is: "..rotation, 0, 225 0 )
    end
)

See Also

Shared