[HELP] Remove Items From Clothes Shop

Relatively simple question.

Is there a way I can prevent players from purchasing specific clothes components such as the earpiece and police torso?

Need to remove some from my server to make it more immersive. Whether its removing them from the shop completely or running a check to see if the player has bought a specific clothing item, I dont really mind.

Kind Regards,
Harry Catraz

1 Like

I have the same question…

Tried messing around, here’s something that’ll hopefully get you started:

Citizen.CreateThread(function()
	ESX.TriggerServerCallback('esx_skin:getPlayerSkin', function(skin)
		if ['tshirt_1'] = 126 then
			TriggerEvent('skinchanger:loadSkin', skin)
		end
	end)
end)
1 Like

Tried using this but no luck:

local PlayerData = {}
ESX = nil
Citizen.CreateThread(function()
    while ESX == nil do
        TriggerEvent('esx:getSharedObject', function(obj) ESX = obj end)
        Citizen.Wait(0)
    end
    while ESX.GetPlayerData().job == nil do
        Citizen.Wait(10)
    end
    PlayerData = ESX.GetPlayerData()
end)

Citizen.CreateThread(function()
    while true do 
        Citizen.Wait(0)
		ESX.TriggerServerCallback('esx_skin:getPlayerSkin', function(skin)
            if PlayerData.job ~= nil and PlayerData.job.name ~= 'police' then
                if ['tshirt_1'] == 129 or ['tshirt_1'] == 122 or ['tshirt_1'] == 58 then -- Duty Belts
                    local clothesSkin = {
        				['tshirt_1'] = 57,    
        				['tshirt_2'] = 0
					}
    				TriggerEvent('skinchanger:loadClothes', skin, clothesSkin)
                    ESX.ShowNotification("Server: You may not wear police equipment!")
                end
                if ['helmet_1'] == 46 then -- Police Hat
			       	local clothesSkin = {
			           	['helmet_1'] = -1,   
			           	['helmet_2'] = 0
					}
			       	TriggerEvent('skinchanger:loadClothes', skin, clothesSkin)
                    ESX.ShowNotification("Server: You may not wear police equipment!")
                end
                if ['torso_1'] == 55 then -- Police Torso
			       	local clothesSkin = {
						['torso_1'] = 53,    
						['torso_2'] = 0
					}
			       	TriggerEvent('skinchanger:loadClothes', skin, clothesSkin)
                    ESX.ShowNotification("Server: You may not wear police equipment!")
                end                
            end  
            if ['ears_1'] == 0 or ['ears_1'] == 1 or ['ears_1'] == 2 then -- Earpieces
                ClearPedProp(GetPlayerPed(-1), 2)
                ESX.ShowNotification("Server: You may not wear earpieces!")
            end  
            if ['helmet_1'] == 57 or ['helmet_1'] == 115 or ['helmet_1'] == 116 or ['helmet_1'] == 117 or ['helmet_1'] == 118 or ['helmet_1'] == 119 or ['helmet_1'] == 134 then -- Modern Helmets
		       	local clothesSkin = {
		           	['helmet_1'] = -1,   
		           	['helmet_2'] = 0
				}
		       	TriggerEvent('skinchanger:loadClothes', skin, clothesSkin)
                ESX.ShowNotification("Server: You may not wear that helmets!")
            end  
        end)
    end
end)

Error of unknown symbol on line 19.

Any ideas?

1 Like

Same question.

Harry make a release about this Topic. Here the link [RELEASE][ESX] Skin Blocker/Restrict Clothing

Yeah, I responded to that one. Thank you.

1 Like