Hello,
I was trying to edit Ox Inventory to add clothing as items. The idea I had is: when the player opens their inventory, it should display what they’re currently wearing in the appropriate clothing slots. For example, if they’re wearing mask 192, an item representing that mask (with metadata) will appear in the correct slot. Then, to switch masks, the player could just swap it with another mask item in their inventory.
Not sure if that was super clear — but that’s not really the main issue. (You can check the code out on my GitHub if you need.)
I’m currently at the point where I want to send the items to the frontend. To do this, I tried using the natives: GetPedPropIndex(GetPlayerPed(-1), XX) and GetPedPropTextureIndex(GetPlayerPed(-1), XX), but they keep returning -1 regardless of the component index I use. I tried both GetPlayerPed(-1) and PlayerPedId() but neither works.
I did some searching and couldn’t find any info about those natives being deprecated or removed.
For context, I’m using FiveM server build b13943. I know it’s not the latest recommended build, but let’s be honest — who actually uses the latest “recommended” one? It’s been over a year without a “stable” release, and most modern frameworks (like ESX) rely on the newer builds anyway.
Have a good one,
NeyZzO
TL;DR:
I’m having issues with the natives GetPedPropIndex and GetPedPropTextureIndex, which keep returning -1 on FiveM server build b13943.