The Lab
INVENTORY native

INVENTORY_GET_GUID_FROM_ITEMID

returns BOOL5 paramsbuild 1207

Looks up the GUID of item p2 in slot slotId under the parent guid and writes it to outGuid. Returns true if the item was found.

Signature

C
BOOL INVENTORY_GET_GUID_FROM_ITEMID(int inventoryId, Any* guid, Hash p2, Hash slotId, Any* outGuid); // 0x886DFD3E185C8A89 b1207

Parameters

#NameType
1inventoryIdint
2guidAny* (out pointer)
3p2Hash
4slotIdHash
5outGuidAny* (out pointer)

Facts

Facts about INVENTORY_GET_GUID_FROM_ITEMID
Name
INVENTORY_GET_GUID_FROM_ITEMID
Hash
0x886DFD3E185C8A89
Namespace
Returns
BOOL
Game build
1207

Examples

Calls by hash work in every RedM runtime. Replace the placeholder arguments with your own values.

Lua
local result, guid, outGuid = Citizen.InvokeNative(0x886DFD3E185C8A89, -- INVENTORY_GET_GUID_FROM_ITEMID
  0, -- int inventoryId
  Citizen.PointerValueInt(), -- Any* guid
  GetHashKey("name"), -- Hash p2
  GetHashKey("name"), -- Hash slotId
  Citizen.PointerValueInt(), -- Any* outGuid
  Citizen.ReturnResultAnyway()
)
if result then
  -- ...
end
JavaScript
const [result, guid, outGuid] = Citizen.invokeNative("0x886DFD3E185C8A89", // INVENTORY_GET_GUID_FROM_ITEMID
  0, // int inventoryId
  Citizen.pointerValueInt(), // Any* guid
  GetHashKey("name"), // Hash p2
  GetHashKey("name"), // Hash slotId
  Citizen.pointerValueInt(), // Any* outGuid
  Citizen.returnResultAnyway()
);
if (result) {
  // ...
}
C#
var guidArg = new OutputArgument();
var outGuidArg = new OutputArgument();
bool result = Function.Call<bool>((Hash)0x886DFD3E185C8A89, // INVENTORY_GET_GUID_FROM_ITEMID
  0, // int inventoryId
  guidArg, // Any* guid
  (uint)API.GetHashKey("name"), // Hash p2
  (uint)API.GetHashKey("name"), // Hash slotId
  outGuidArg // Any* outGuid
);
int guid = guidArg.GetResult<int>();
int outGuid = outGuidArg.GetResult<int>();
All INVENTORY natives

Facts compiled from community research (alloc8or/rdr3-nativedb-data, femga/rdr3_discoveries); descriptions and examples by The Lab.