CameraClient

createCamWithParams

CREATE_CAM_WITH_PARAMS0xB51194800B257161

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

SignatureJavaScript
createCamWithParams(
  camName: string,
  posX: number,
  posY: number,
  posZ: number,
  rotX: number,
  rotY: number,
  rotZ: number,
  fov: number,
  p8: boolean,
  p9: number
): Cam
SignatureLua
createCamWithParams(
  camName: string,
  posX: number,
  posY: number,
  posZ: number,
  rotX: number,
  rotY: number,
  rotZ: number,
  fov: number,
  p8: boolean,
  p9: integer
): Cam

Usage

JavaScript
const cam = createCamWithParams(camName, posX, posY, posZ, rotX, rotY, rotZ, fov, p8, p9);
Lua
local cam = createCamWithParams(camName, posX, posY, posZ, rotX, rotY, rotZ, fov, p8, p9)

Three consecutive numbers can be given as one vector: { x, y, z } (or [x, y, z]) in JavaScript, a Vector3 in Lua.

JavaScript · with vectors
const cam = createCamWithParams(camName, pos, rot, fov, p8, p9);
Lua · with vectors
local cam = createCamWithParams(camName, pos, rot, fov, p8, p9)

Parameters

ParameterTypeJavaScriptLua
camNamestringstringstring
posXfloatnumbernumber
posYfloatnumbernumber
posZfloatnumbernumber
rotXfloatnumbernumber
rotYfloatnumbernumber
rotZfloatnumbernumber
fovfloatnumbernumber
p8BOOLbooleanboolean
p9intnumberinteger

Returns

Cam JavaScript number, Lua integer

Handle of a scripted camera.

Notes

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

camName is always set to "DEFAULT_SCRIPTED_CAMERA" in Rockstar's scripts.


Camera names found in the b617d scripts:
"DEFAULT_ANIMATED_CAMERA"
"DEFAULT_SCRIPTED_CAMERA"
"DEFAULT_SCRIPTED_FLY_CAMERA"
"DEFAULT_SPLINE_CAMERA"


Side Note: It seems p8 is basically to represent what would be the bool p1 within createCam native. As well as the p9 since it's always 2 in scripts seems to represent what would be the last param within setCamRot native which normally would be 2.

Reference

Namespace
Camera CAM
In the game
Cam CREATE_CAM_WITH_PARAMS(const char* camName, float posX, float posY, float posZ, float rotX, float rotY, float rotZ, float fov, BOOL p8, int p9)
Hash
0xB51194800B257161

Open in the interactive natives reference