PedClient

addPedDecorationFromHashes

ADD_PED_DECORATION_FROM_HASHES0x5F5D1665E352A839

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

SignatureJavaScript
addPedDecorationFromHashes(ped: Ped, collection: Hash, overlay: Hash): void
SignatureLua
addPedDecorationFromHashes(ped: Ped, collection: Hash, overlay: Hash)

Usage

JavaScript
addPedDecorationFromHashes(ped, collection, overlay);
Lua
addPedDecorationFromHashes(ped, collection, overlay)

Parameters

ParameterTypeJavaScriptLua
pedPednumberinteger
collectionHashnumberinteger
overlayHashnumberinteger

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.

Applies an Item from a PedDecorationCollection to a ped. These include tattoos and shirt decals.

collection - PedDecorationCollection filename hash
overlay - Item name hash

Example:
Entry inside "mpbeach_overlays.xml" -
<Item>
<uvPos x="0.500000" y="0.500000" />
<scale x="0.600000" y="0.500000" />
<rotation value="0.000000" />
<nameHash>FM_Hair_Fuzz</nameHash>
<txdHash>mp_hair_fuzz</txdHash>
<txtHash>mp_hair_fuzz</txtHash>
<zone>ZONE_HEAD</zone>
<type>TYPE_TATTOO</type>
<faction>FM</faction>
<garment>All</garment>
<gender>GENDER_DONTCARE</gender>
<award />
<awardLevel />
</Item>

Code:
addPedDecorationFromHashes(playerPedId(), getHashKey("mpbeach_overlays"), getHashKey("fm_hair_fuzz"))

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

Reference

Namespace
Ped PED
In the game
void ADD_PED_DECORATION_FROM_HASHES(Ped ped, Hash collection, Hash overlay)
Hash
0x5F5D1665E352A839
Formerly
_APPLY_PED_OVERLAY _SET_PED_DECORATION

Open in the interactive natives reference