getPedCameraRotation
Client
Tells where a ped's camera faces, in degrees. On the local player it is the game camera; on a remote player, the one that came over the network; on a ped, the one a script set.
Also exists on the server, with its own implementation: getPedCameraRotation
float|false getPedCameraRotation(ped thePed)
Parameters
| Name | Type | Description |
|---|---|---|
| thePed | ped | The ped or player. |
Returns
The rotation in degrees around the vertical axis, or false if the ped cannot be read.
Example
addEventHandler("onClientRender", root, function()
local rotation = getPedCameraRotation(localPlayer)
if rotation then
dxDrawText(string.format("Câmera: %.0f°", rotation), 20, 300)
end
end)