You can see the natives used in GetComponentsData function in client/main.lua
, it uses first GetNumberOfPedDrawableVariations, then GetNumberOfPedTextureVariations for every drawable.
To retrieve name, it uses a method shown here. Native used to obtain the struct with data is GetShopPedComponent, called with:
Citizen.InvokeNative(0x74C0E2A57EC66760, hash, blob)
Then the struct is unpacked and name is obtained with GetLabelText on gxt
field:
function GetComponentDataFromHash(hash)
local blob = string.rep('\0\0\0\0\0\0\0\0', 9 + 16)
if not Citizen.InvokeNative(0x74C0E2A57EC66760, hash, blob) then
return nil
end
local lockHash = string.unpack('<i4', blob, 1)
local hash = string.unpack('<i4', blob, 9)
local locate = string.unpack('<i4', blob, 17)
local drawable = string.unpack('<i4', blob, 25)
local texture = string.unpack('<i4', blob, 33)
local field5 = string.unpack('<i4', blob, 41)
local component = string.unpack('<i4', blob, 49)
local field7 = string.unpack('<i4', blob, 57)
local field8 = string.unpack('<i4', blob, 65)
local gxt = string.unpack('c64', blob, 73)
return component, drawable, texture, gxt, field5, field7, field8
end
This is all repeated for props, since they use separate set of natives.
I guess that what you define in this xml, can be retrieved from that struct if it has a hash name (that GetShopPedComponent takes as argument).
I’ve noticed that you don’t define a hash name for your added clothes anywhere and I’m not sure if that’s even possible.
At one point cui_character uses GetHashNameForComponent on each component/drawable/texture group. If the hash is 0, that group is then skipped entirely. I think that this is what eliminates your custom clothes from the list.