_GET_SHOP_ITEM_COMPONENT_AT_INDEX
Returns 0 if index invalid/unresolvable; else the shop component hash.
Hash
0x77BA37622E22023BRuntime name
GetShopItemComponentAtIndexNamespacePED
SideClient
NameCommunity guess
Docs
Since build1207
Signature
Hash _GET_SHOP_ITEM_COMPONENT_AT_INDEX(Ped ped, int index, BOOL resolveSelection, BOOL* outStatusFlag, Hash* outWearableState);Parameters
| Name | Type | Description |
|---|---|---|
ped | Ped | — |
index | int | — |
resolveSelection | BOOL | — |
outStatusFlag | BOOL* | — |
outWearableState | Hash* | — |
Returns Hash
Description
Returns 0 if index invalid/unresolvable; else the shop component hash.
resolveSelection: true -> run the resolver (rebuild from ped meta/outfit - MP “net shop” style); false -> use cached entry only (singleplayer - offline).
outStatusFlag: Set to 1 if the entry's internal status byte != 0.
outWearableState: See _UPDATE_SHOP_ITEM_WEARABLE_STATE
Returns the current shop item component at index and it's wearable state
Usage
local retval, outStatusFlag, outWearableState = GetShopItemComponentAtIndex(ped, index, resolveSelection)
-- always works, by hash
local retval, outStatusFlag, outWearableState = Citizen.InvokeNative(0x77BA37622E22023B, ped, index, resolveSelection, Citizen.PointerValueInt() --[[ BOOL* ]], Citizen.PointerValueInt(), Citizen.ResultAsInteger())JavaScript and C#
const [retval, outStatusFlag, outWearableState] = GetShopItemComponentAtIndex(ped, index, resolveSelection);
// by hash
const [retval, outStatusFlag, outWearableState] = Citizen.invokeNative('0x77BA37622E22023B', ped, index, resolveSelection, Citizen.pointerValueInt() /* BOOL* */, Citizen.pointerValueInt(), Citizen.returnResultAnyway(), Citizen.resultAsInteger());var outStatusFlag = new OutputArgument();
var outWearableState = new OutputArgument();
int retval = Function.Call<int>((Hash)0x77BA37622E22023B, ped, index, resolveSelection, outStatusFlag, outWearableState);
// outStatusFlag.GetResult<bool>()
// outWearableState.GetResult<int>()- 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
InvokeNativewith the hash — it always works.
Examples
local ped = PlayerPedId()
local numComponent = GetNumComponentsInPed(ped)
for index = 0, numComponent -1 do
local componentHash,_,wearableState = GetShopItemComponentAtIndex(ped, index, true, Citizen.ResultAsInteger(), Citizen.ResultAsInteger())
print('Index:',index,'Hash:',componentHash,'wearable state:', wearableState)
endSources
alloc8or RDR3 NativeDB · VORPCORE RDR3natives
Something wrong or missing? Contribute a verified note — corrections ship through pull requests.