getStatHashForCharacterStat
_GET_STAT_HASH_FOR_CHARACTER_STAT0xD69CE161FE614531The GTA V native _GET_STAT_HASH_FOR_CHARACTER_STAT of the STATS namespace, as LS:MP client scripts call it: the global function getStatHashForCharacterStat, in JavaScript and in Lua.
getStatHashForCharacterStat(
dataType: number,
statIndex: number,
charSlot: number
): HashgetStatHashForCharacterStat(
dataType: integer,
statIndex: integer,
charSlot: integer
): Hash⚠
Not in this game build
The global exists, but the native is not part of the game build LS:MP runs: calling it does nothing and returns undefined in JavaScript, nil in Lua. It never throws. See Coverage.
Usage
JavaScript
const hash = getStatHashForCharacterStat(dataType, statIndex, charSlot);Lua
local hash = getStatHashForCharacterStat(dataType, statIndex, charSlot)Parameters
| Parameter | Type | JavaScript | Lua |
|---|---|---|---|
dataType | int | number | integer |
statIndex | int | number | integer |
charSlot | int | number | integer |
Returns
Hash JavaScript number, Lua integerA game hash. Natives return it unsigned (0 to 4294967295), the value lsmp.hash gives. As an argument, the signed and unsigned forms of a hash are the same value.
Notes
From the community native database. Names are LS:MP’s; samples may be written for C++ or another framework.
Returns stat hash based on dataType, statIndex/statId and characterSlot.
Reference
- Namespace
- Stats STATS
- In the game
Hash _GET_STAT_HASH_FOR_CHARACTER_STAT(int dataType, int statIndex, int charSlot)- Hash
0xD69CE161FE614531- Introduced
- Game build 2944 legacy numbering