PedClient

forcePedMotionState

FORCE_PED_MOTION_STATE0xF28965D04F570DCA

The GTA V native FORCE_PED_MOTION_STATE of the PED namespace, as LS:MP client scripts call it: the global function forcePedMotionState, in JavaScript and in Lua.

SignatureJavaScript
forcePedMotionState(
  ped: Ped,
  motionStateHash: Hash,
  shouldReset: boolean,
  updateState: number,
  forceAIPreCameraUpdate: boolean
): boolean
SignatureLua
forcePedMotionState(
  ped: Ped,
  motionStateHash: Hash,
  shouldReset: boolean,
  updateState: integer,
  forceAIPreCameraUpdate: boolean
): boolean

Usage

JavaScript
const result = forcePedMotionState(
  ped, motionStateHash, shouldReset, updateState, forceAIPreCameraUpdate
);
Lua
local result = forcePedMotionState(
    ped, motionStateHash, shouldReset, updateState, forceAIPreCameraUpdate
)

Parameters

ParameterTypeJavaScriptLua
pedPednumberinteger
motionStateHashHashnumberinteger
shouldResetBOOLbooleanboolean
updateStateintnumberinteger
forceAIPreCameraUpdateBOOLbooleanboolean

Returns

BOOL JavaScript boolean, Lua boolean

Reference

Namespace
Ped PED
In the game
BOOL FORCE_PED_MOTION_STATE(Ped ped, Hash motionStateHash, BOOL shouldReset, int updateState, BOOL forceAIPreCameraUpdate)
Hash
0xF28965D04F570DCA

Open in the interactive natives reference