{"hash":"0x6A0184E904CDF25E","ns":"STATS","name":"_STAT_ID_INCREMENT_INT","slug":"_STAT_ID_INCREMENT_INT","official":false,"named":true,"luaName":"StatIdIncrementInt","game":"rdr3","apiset":"client","returnType":"void","params":[{"name":"statId","type":"Any*"},{"name":"value","type":"int"}],"summary":"Increments an integer stat by the supplied amount.","descriptions":[{"source":"alloc8or","format":"text","body":"statId: see STAT_ID_IS_VALID"},{"source":"vorp","format":"text","body":"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."}],"examples":[{"lang":"lua","code":"local function createStatIdBuffer(statHash)\n    local view = DataView.ArrayBuffer(8)\n    view:SetInt32(0, statHash, true)\n    view:SetInt32(4, 0, true)\n    return view\nend\n\nlocal statId = createStatIdBuffer(GetHashKey(\"FISH_ESCAPED\"))\nCitizen.InvokeNative(0x6A0184E904CDF25E, statId:Buffer(), 1)","source":"vorp"}],"aliases":[],"enums":[],"related":[],"build":"1207","sources":["alloc8or","vorp"],"doc":3,"url":"https://natives.borderlinerp.com/natives/STATS/_STAT_ID_INCREMENT_INT","markdownUrl":"https://natives.borderlinerp.com/natives/STATS/_STAT_ID_INCREMENT_INT.md","snippets":{"lua":"local statId = StatIdIncrementInt(value)","luaInvoke":"local statId = Citizen.InvokeNative(0x6A0184E904CDF25E, Citizen.PointerValueInt(), value)","js":"const statId = StatIdIncrementInt(value);","jsInvoke":"const statId = Citizen.invokeNative('0x6A0184E904CDF25E', Citizen.pointerValueInt(), value);","csharp":"var statId = new OutputArgument();\nFunction.Call((Hash)0x6A0184E904CDF25E, statId, value);\n// statId.GetResult<int>()","notes":["Pointer (out) arguments are not passed in Lua/JS: their values are returned after the result, in order.","`Any*` arguments are often structs. Build them with a DataView buffer and pass it with `:Buffer()` — see the examples and notes below.","The name is a community guess and may change. If the named call is missing in your client build, use `InvokeNative` with the hash — it always works."]}}