_STAT_ID_INCREMENT_INT
Increments an integer stat by the supplied amount. `statId` is not a raw stat hash; it is a stat-id buffer/struct in the same format used by STAT_ID_IS_VALID. In common usage this is an 8-byte buffer with the stat hash written as int32 at offset 0 and 0 written as int32 at offset 4. Use this for counter-style stats, for example incrementing FISH_ESCAPED by 1. The first argument is not a plain integer stat hash; it is a stat-id buffer.
STATSBuild 1207
Signature
lua
StatIdIncrementInt(statId, 0)
-- returns voidParameters
| Name | Type | Description |
|---|---|---|
| Any* | — | |
| int | — |
Usage
Named call
StatIdIncrementInt(statId, 0)InvokeNative
Citizen.InvokeNative(0x6A0184E904CDF25E, statId, 0)lua 1
local function createStatIdBuffer(statHash)
local view = DataView.ArrayBuffer(8)
view:SetInt32(0, statHash, true)
view:SetInt32(4, 0, true)
return view
end
local statId = createStatIdBuffer(GetHashKey("FISH_ESCAPED"))
Citizen.InvokeNative(0x6A0184E904CDF25E, statId:Buffer(), 1)Details
- Hash
- Source
- VORPCORE/RDR3natives
Source: VORPCORE/RDR3natives
