{"hash":"0x77BA37622E22023B","ns":"PED","name":"_GET_SHOP_ITEM_COMPONENT_AT_INDEX","slug":"_GET_SHOP_ITEM_COMPONENT_AT_INDEX","official":false,"named":true,"luaName":"GetShopItemComponentAtIndex","game":"rdr3","apiset":"client","returnType":"Hash","params":[{"name":"ped","type":"Ped"},{"name":"index","type":"int"},{"name":"resolveSelection","type":"BOOL"},{"name":"outStatusFlag","type":"BOOL*"},{"name":"outWearableState","type":"Hash*"}],"summary":"Returns 0 if index invalid/unresolvable; else the shop component hash.","descriptions":[{"source":"alloc8or","format":"text","body":"Returns 0 if index invalid/unresolvable; else the shop component hash.\nresolveSelection: true -> run the resolver (rebuild from ped meta/outfit - MP “net shop” style); false -> use cached entry only (singleplayer - offline).\noutStatusFlag: Set to 1 if the entry's internal status byte != 0.\noutWearableState: See _UPDATE_SHOP_ITEM_WEARABLE_STATE"},{"source":"vorp","format":"text","body":"Returns the current shop item component at index and it's wearable state"}],"examples":[{"lang":"lua","code":"local ped = PlayerPedId()\nlocal numComponent = GetNumComponentsInPed(ped)\nfor index = 0, numComponent -1 do\n\tlocal componentHash,_,wearableState = GetShopItemComponentAtIndex(ped, index, true, Citizen.ResultAsInteger(), Citizen.ResultAsInteger())\n\tprint('Index:',index,'Hash:',componentHash,'wearable state:', wearableState)\nend","source":"vorp"}],"aliases":[],"enums":[],"related":[],"build":"1207","sources":["alloc8or","vorp"],"doc":3,"url":"https://natives.borderlinerp.com/natives/PED/_GET_SHOP_ITEM_COMPONENT_AT_INDEX","markdownUrl":"https://natives.borderlinerp.com/natives/PED/_GET_SHOP_ITEM_COMPONENT_AT_INDEX.md","snippets":{"lua":"local retval, outStatusFlag, outWearableState = GetShopItemComponentAtIndex(ped, index, resolveSelection)","luaInvoke":"local retval, outStatusFlag, outWearableState = Citizen.InvokeNative(0x77BA37622E22023B, ped, index, resolveSelection, Citizen.PointerValueInt() --[[ BOOL* ]], Citizen.PointerValueInt(), Citizen.ResultAsInteger())","js":"const [retval, outStatusFlag, outWearableState] = GetShopItemComponentAtIndex(ped, index, resolveSelection);","jsInvoke":"const [retval, outStatusFlag, outWearableState] = Citizen.invokeNative('0x77BA37622E22023B', ped, index, resolveSelection, Citizen.pointerValueInt() /* BOOL* */, Citizen.pointerValueInt(), Citizen.returnResultAnyway(), Citizen.resultAsInteger());","csharp":"var outStatusFlag = new OutputArgument();\nvar outWearableState = new OutputArgument();\nint retval = Function.Call<int>((Hash)0x77BA37622E22023B, ped, index, resolveSelection, outStatusFlag, outWearableState);\n// outStatusFlag.GetResult<bool>()\n// outWearableState.GetResult<int>()","notes":["Pointer (out) arguments are not passed in Lua/JS: their values are returned after the result, in order.","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."]}}