PedClientChecked by LS:MP

isPedComponentVariationValid

IS_PED_COMPONENT_VARIATION_VALID0xE825F6B6CEA7671D

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

SignatureJavaScript
isPedComponentVariationValid(
  ped: Ped,
  componentId: number,
  drawableId: number,
  textureId: number
): boolean
SignatureLua
isPedComponentVariationValid(
  ped: Ped,
  componentId: integer,
  drawableId: integer,
  textureId: integer
): boolean

Usage

JavaScript
const result = isPedComponentVariationValid(ped, componentId, drawableId, textureId);
Lua
local result = isPedComponentVariationValid(ped, componentId, drawableId, textureId)

Parameters

ParameterTypeJavaScriptLua
pedPednumberinteger
componentIdintnumberinteger
drawableIdintnumberinteger
textureIdintnumberinteger

Returns

BOOL JavaScript boolean, Lua boolean

On LS:MP

ℹ
Checked by LS:MP

componentId must be between 0 and 11. Otherwise the call is ignored and returns false: nothing reaches the game, and no error is raised.

Notes

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

Checks if the component variation is valid, this works great for randomizing components using loops.

List of component/props ID
gtaxscripting.blogspot.com/2016/04/gta-v-peds-component-and-props.html

Full list of ped components by DurtyFree: https://github.com/DurtyFree/gta-v-data-dumps/blob/master/pedComponentVariations.json

Reference

Namespace
Ped PED
In the game
BOOL IS_PED_COMPONENT_VARIATION_VALID(Ped ped, int componentId, int drawableId, int textureId)
Hash
0xE825F6B6CEA7671D

Open in the interactive natives reference