INVENTORY_GET_GUID_FROM_ITEMID
Hash
0x886DFD3E185C8A89Runtime name
InventoryGetGuidFromItemidNamespaceINVENTORY
SideClient
NameOfficial
Docs
Since build1207
Signature
BOOL INVENTORY_GET_GUID_FROM_ITEMID(int inventoryId, Any* guid, Hash p2, Hash slotId, Any* outGuid);Parameters
| Name | Type | Description |
|---|---|---|
inventoryId | int | — |
guid | Any* | — |
p2 | Hash | — |
slotId | Hash | — |
outGuid | Any* | — |
Returns BOOL
Usage
local retval, guid, outGuid = InventoryGetGuidFromItemid(inventoryId, p2, slotId)
-- always works, by hash
local retval, guid, outGuid = Citizen.InvokeNative(0x886DFD3E185C8A89, inventoryId, Citizen.PointerValueInt(), p2, slotId, Citizen.PointerValueInt(), Citizen.ReturnResultAnyway())JavaScript and C#
const [retval, guid, outGuid] = InventoryGetGuidFromItemid(inventoryId, p2, slotId);
// by hash
const [retval, guid, outGuid] = Citizen.invokeNative('0x886DFD3E185C8A89', inventoryId, Citizen.pointerValueInt(), p2, slotId, Citizen.pointerValueInt(), Citizen.returnResultAnyway());var guid = new OutputArgument();
var outGuid = new OutputArgument();
bool retval = Function.Call<bool>((Hash)0x886DFD3E185C8A89, inventoryId, guid, p2, slotId, outGuid);
// guid.GetResult<int>()
// outGuid.GetResult<int>()- Hash parameters: the named function also accepts a string and hashes it for you;
Citizen.InvokeNativeneeds the number — passjoaat("name")or a backtick literal like`name`. - 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.
Sources
Something wrong or missing? Contribute a verified note — corrections ship through pull requests.