EntityClient

setEntityRotation

SET_ENTITY_ROTATION0x8524A8B0171D5E07

The GTA V native SET_ENTITY_ROTATION of the ENTITY namespace, as LS:MP client scripts call it: the global function setEntityRotation, in JavaScript and in Lua.

SignatureJavaScript
setEntityRotation(
  entity: Entity,
  pitch: number,
  roll: number,
  yaw: number,
  rotationOrder: number,
  p5: boolean
): void
SignatureLua
setEntityRotation(
  entity: Entity,
  pitch: number,
  roll: number,
  yaw: number,
  rotationOrder: integer,
  p5: boolean
)

Usage

JavaScript
setEntityRotation(entity, pitch, roll, yaw, rotationOrder, p5);
Lua
setEntityRotation(entity, pitch, roll, yaw, rotationOrder, p5)

Parameters

ParameterTypeJavaScriptLua
entityEntitynumberinteger
pitchfloatnumbernumber
rollfloatnumbernumber
yawfloatnumbernumber
rotationOrderintnumberinteger
p5BOOLbooleanboolean

Returns

Nothing. In JavaScript the call evaluates to undefined.

Notes

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

rotationOrder refers to the order yaw pitch roll is applied
value ranges from 0 to 5. What you use for rotationOrder when setting must be the same as rotationOrder when getting the rotation.
Unsure what value corresponds to what rotation order, more testing will be needed for that.
For the most part R* uses 1 or 2 as the order.
p5 is usually set as true

Reference

Namespace
Entity ENTITY
In the game
void SET_ENTITY_ROTATION(Entity entity, float pitch, float roll, float yaw, int rotationOrder, BOOL p5)
Hash
0x8524A8B0171D5E07

Open in the interactive natives reference