CameraClient

getGameplayCamRot

GET_GAMEPLAY_CAM_ROT0x837765A25378F0BB

The GTA V native GET_GAMEPLAY_CAM_ROT of the CAM namespace, as LS:MP client scripts call it: the global function getGameplayCamRot, in JavaScript and in Lua.

SignatureJavaScript
getGameplayCamRot(rotationOrder: number): { x: number, y: number, z: number }
SignatureLua
getGameplayCamRot(rotationOrder: integer): Vector3

Usage

JavaScript
const { x, y, z } = getGameplayCamRot(rotationOrder);
Lua
local coords = getGameplayCamRot(rotationOrder)
-- coords.x, coords.y, coords.z

Parameters

ParameterTypeJavaScriptLua
rotationOrderintnumberinteger

Returns

Vector3 JavaScript { x: number, y: number, z: number }, Lua Vector3

A 3D vector. JavaScript gets a plain { x, y, z } object; Lua gets a real Vector3, with .x .y .z and arithmetic. As an argument, one vector fills three consecutive coordinates.

Notes

From the community native database. Names are LS:MP’s; samples may be written for C++ or another framework.

p0 dosen't seem to change much, I tried it with 0, 1, 2:
0-Pitch(X): -70.000092
0-Roll(Y): -0.000001
0-Yaw(Z): -43.886459
1-Pitch(X): -70.000092
1-Roll(Y): -0.000001
1-Yaw(Z): -43.886463
2-Pitch(X): -70.000092
2-Roll(Y): -0.000002
2-Yaw(Z): -43.886467

Reference

Namespace
Camera CAM
In the game
Vector3 GET_GAMEPLAY_CAM_ROT(int rotationOrder)
Hash
0x837765A25378F0BB

Open in the interactive natives reference