isPedComponentVariationValid
IS_PED_COMPONENT_VARIATION_VALID0xE825F6B6CEA7671DThe 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.
isPedComponentVariationValid(
ped: Ped,
componentId: number,
drawableId: number,
textureId: number
): booleanisPedComponentVariationValid(
ped: Ped,
componentId: integer,
drawableId: integer,
textureId: integer
): booleanUsage
JavaScript
const result = isPedComponentVariationValid(ped, componentId, drawableId, textureId);Lua
local result = isPedComponentVariationValid(ped, componentId, drawableId, textureId)Parameters
| Parameter | Type | JavaScript | Lua |
|---|---|---|---|
ped | Ped | number | integer |
componentId | int | number | integer |
drawableId | int | number | integer |
textureId | int | number | integer |
Returns
BOOL JavaScript boolean, Lua booleanOn 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