_INVENTORY_ADD_ITEM_WITH_GUID
Adds item to inventory inventoryId under the parent GUID, writing the new item's GUID, and tags the change with addReason. Returns true on success.
Signature
BOOL _INVENTORY_ADD_ITEM_WITH_GUID(int inventoryId, Any* guid1, Any* guid2, Hash item, Hash inventoryItemSlot, int p5, Hash addReason); // 0xCB5D11F9508A928D b1207Parameters
| # | Name | Type |
|---|---|---|
| 1 | inventoryId | int |
| 2 | guid1 | Any* (out pointer) |
| 3 | guid2 | Any* (out pointer) |
| 4 | item | Hash |
| 5 | inventoryItemSlot | Hash |
| 6 | p5 | int |
| 7 | addReason | Hash |
Facts
| Name | _INVENTORY_ADD_ITEM_WITH_GUID |
|---|---|
| Hash | 0xCB5D11F9508A928D |
| Namespace | |
| Returns | BOOL |
| Game build | 1207 |
Examples
Calls by hash work in every RedM runtime. Replace the placeholder arguments with your own values.
local result, guid1, guid2 = Citizen.InvokeNative(0xCB5D11F9508A928D, -- _INVENTORY_ADD_ITEM_WITH_GUID
0, -- int inventoryId
Citizen.PointerValueInt(), -- Any* guid1
Citizen.PointerValueInt(), -- Any* guid2
GetHashKey("name"), -- Hash item
GetHashKey("name"), -- Hash inventoryItemSlot
0, -- int p5
GetHashKey("name"), -- Hash addReason
Citizen.ReturnResultAnyway()
)
if result then
-- ...
endconst [result, guid1, guid2] = Citizen.invokeNative("0xCB5D11F9508A928D", // _INVENTORY_ADD_ITEM_WITH_GUID
0, // int inventoryId
Citizen.pointerValueInt(), // Any* guid1
Citizen.pointerValueInt(), // Any* guid2
GetHashKey("name"), // Hash item
GetHashKey("name"), // Hash inventoryItemSlot
0, // int p5
GetHashKey("name"), // Hash addReason
Citizen.returnResultAnyway()
);
if (result) {
// ...
}var guid1Arg = new OutputArgument();
var guid2Arg = new OutputArgument();
bool result = Function.Call<bool>((Hash)0xCB5D11F9508A928D, // _INVENTORY_ADD_ITEM_WITH_GUID
0, // int inventoryId
guid1Arg, // Any* guid1
guid2Arg, // Any* guid2
(uint)API.GetHashKey("name"), // Hash item
(uint)API.GetHashKey("name"), // Hash inventoryItemSlot
0, // int p5
(uint)API.GetHashKey("name") // Hash addReason
);
int guid1 = guid1Arg.GetResult<int>();
int guid2 = guid2Arg.GetResult<int>();Related INVENTORY natives
- _INVENTORY_GET_INVENTORY_ITEM_COUNT_WITH_GUID
- _INVENTORY_REMOVE_INVENTORY_ITEM_WITH_GUID
- _INVENTORY_EQUIP_ITEM_WITH_GUID
- _INVENTORY_GET_INVENTORY_ITEM_COUNT_WITH_ITEMID
- _INVENTORY_REMOVE_INVENTORY_ITEM_WITH_ITEMID
- _INVENTORY_COPY_ITEM_TO_INVENTORY
- _INVENTORY_COPY_ITEM_TO_MISSION_INVENTORY
- _INVENTORY_CREATE_ITEM_COLLECTION_WITH_FILTER
- _INVENTORY_GET_FULL_INVENTORY_ITEM_DATA
- _INVENTORY_GET_INVENTORY_ITEM_CHILD
- _INVENTORY_GET_INVENTORY_ITEM_COMPATIBLE_SLOTS
- _INVENTORY_GET_INVENTORY_ITEM_DESCRIPTION_HASH
Facts compiled from community research (alloc8or/rdr3-nativedb-data, femga/rdr3_discoveries); descriptions and examples by The Lab.