Hi guys,
Need a little help. I haven’t coded for a good few years, just getting back into it for FiveM. I am making a /hat command that will set police hats for my cops. I have gone through the game files and have found all of the hat IDs such as:
s_f_y_cop_01_p.ydd - p_head_000
s_m_y_cop_01_p.ydd - p_head_000
How would I make a resource to turn these into a /hat command? I have looked at a few other resources and get the whole client/server files side of things but I’m not too sure on which functions to use and what they would come under, either server or client. I think I would need to use:
SET_PED_PROP_INDEX(Ped ped, int componentId, int drawableId, int TextureId, BOOL attach)
But wasn’t sure what the component ids and texture ids would be in relation to the hat IDs I had found from the game files. I also wasn’t sure how the command would work, whether it would need to send the command from the client to the server then the server return something to the client file. Any help would be greatly appreciated. If I can figure out how to make commands work and what functions I’d need I could probably get the rest of the Lua down. Just shaking off the rust still.
If I get this down I’d like to eventually tie it into my permissions system so only my cops can use it. But just getting a command that cycles through a few hats would be an awesome start.
Also any helpful resources would be greatly appreciated.
Thanks in advance,
CombatMedic02