Knowledge from the fieldRedM

_GET_SHOP_ITEM_COMPONENT_CATEGORY (0x5FF9A878C3D115B8): falsy with isMP=true means it's an SP component — retry with false

learning:68

_GET_SHOP_ITEM_COMPONENT_CATEGORY (0x5FF9A878C3D115B8): falsy with isMP=true means it's an SP component — retry with false

Context

_GET_SHOP_ITEM_COMPONENT_CATEGORY (0x5FF9A878C3D115B8) needs the correct isMP flag, and the result tells you which kind a component hash is. This is jo_libs' canonical MP-vs-SP detection idiom.

The idiom

local cat = GetShopItemComponentCategory(hash, GetMetaPedType(ped), true)   -- try MP
local isMp = true
if not cat then                                                            -- falsy => not MP
  isMp = false
  cat = GetShopItemComponentCategory(hash, GetMetaPedType(ped), false)     -- it's SP
end

Trap

Calling with the wrong isMP returns a null/zero category, and the subsequent apply (_APPLY_SHOP_ITEM_TO_PED) silently no-ops. Use the falsy-result-then-retry pattern to discover whether a clothing hash is an MP or SP component.

Verified

component/g_client.lua:397-419.

Linked natives

  • _GET_SHOP_ITEM_COMPONENT_CATEGORY (0x5FF9A878C3D115B8)

Tags: ped, metaped, component, mp, shop-item, category
Category: natives
Source: jo_libs-fleet
Created: 2026-05-31T09:43:00.905Z

Back to documentation