Hi all,
Some people are having issues with the trigger or not sure where to put it so here are some details.
In short, any time you are about to change the clothing on a player, you will want to run the included trigger TriggerEvent('dpc:EquipLast')
Here is an example scenario and why you need the trigger: say you are wearing a red shirt and you use dpClothing to take it off, the menu saves your red shirt - if you then go in to a shop and put on a blue shirt, when you open dpClothing and click ‘put shirt back on’ it will change your blue shirt back to the red shirt (you don’t want this)
What the trigger does is ‘reset’ the menu back to normal state so that nothing is ‘taken off’ that way when you change clothes in the shop you can’t put the red shirt back on.
Here is an example of where I have put my triggers:
esx_clotheshop
Look for:
function OpenShopMenu()
hasPaid = false
openedMenu = true
TriggerEvent('esx_skin:openRestrictedMenu', function(data, menu)
menu.close()
Add the trigger at the bottom (note the last line)
function OpenShopMenu()
hasPaid = false
openedMenu = true
TriggerEvent('esx_skin:openRestrictedMenu', function(data, menu)
menu.close()
TriggerEvent("dpc:EquipLast")
This will reset the dpClothing menu as they open up the shop menu (you could also put it right before it changes their skin, however they could still put on the ‘red shirt’ while they are in the clothing change menu).
Make sure you put it in each resource which changes the player skin, you can search for skinchanger:loadSkin
in all your resources.
~ Uki