I am trying to create an extra option in the police cloakroom menu that will change the player’s hat.
I am using the freemode models so I just need to use the pre-written lines to change the model’s clothes.
The button shows in the game but when I go to use the button it doesn’t change the hat.
I have edited the client/main.lua of the police job and added in the 5th line in the elements variable.
local elements = {
{ label = _U('citizen_wear'), value = 'citizen_wear' },
{ label = _U('bullet_wear'), value = 'bullet_wear' },
{ label = _U('gilet_wear'), value = 'gilet_wear' },
{ label = _U('riot_wear'), value = 'riot_wear' }
}
also added this line in the config.lua on line 390
So for anyone interested in how to add new options in the esx_policejob cloakroom menu you need to follow these steps:
In esx_policejob/config.lua underneath the last entry which will presumably be gilet_wear add these lines:
NOTE: you can name riot_wear anything you’d like. You can also change the helmet_1 and helmet_2 to any other clothing item. Use the lines from other uniforms set above to find what kind of clothing item you’d like to change.
In esx_policejob/client/main.lua add this line into your elements array (should be around line 62):
{ label = _U('riot_wear'), value = 'riot_wear' },
Next add this line onto line 189:
data.current.value == 'riot_wear'
NOTE: Dont forget to put an or at the end of the line above so it should look like this:
if
data.current.value == 'recruit_wear' or
data.current.value == 'officer_wear' or
data.current.value == 'sergeant_wear' or
data.current.value == 'intendent_wear' or
data.current.value == 'lieutenant_wear' or
data.current.value == 'chef_wear' or
data.current.value == 'boss_wear' or
data.current.value == 'bullet_wear' or
data.current.value == 'gilet_wear' or
data.current.value == 'riot_wear'
then
setUniform(data.current.value, playerPed)
end
Then restart esx_policejob and you should be able to use the option in the menu.
Any questions reply here and I’ll see if I can help.