Esx_policejob armor

function OpenArmorMenu()
   ESX.UI.Menu.CloseAll()

   ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'Armor', {
       title = 'Armor',
	   align = 'center',
	   elements = {
	        {label = 'Take', value = 'take'},
			{label = 'Remove', value = 'remove'}
   }},function(data, menu)
	  local action = data.current.value
		  if action == ' take' then
			 TriggerEvent('skinchanger:getSkin',function(skin)
				local  uniformObject
				if skin.sex == 0 then
					uniformObject = Config.Uniforms['bullet_wear'].male
				else
					uniformObject = Config.Uniforms['bullet_wear'].female
				end
				TriggerEvent("skinchanger:loadClothes", skin , uniformObject)
				SetPedArmour(PlayerPedId(), 100)
				PlaySoundFrontend(-1, "PICK_UP", "HUD_FRONTED_DEFAULT_SOUNDSET", true)
				ClearPedTasks(PlayerPedId())
				menu.close()
			 end)
		  elseif action == 'remove' then
		      TriggerEvent('skinchanger:getSkin', function (skin)
				   if skin.sex == 0 then
				       local clothesSkin  = {
					      ["bproof_1"] = 0, ["bproof_2"] = 0 
					   }
					    TriggerEvent("skinchanger:loadClothes", skin , clothesSkin)
				   else
				       local clothesSkin  = {
					      ["bproof_1"] = 0, ["bproof_2"] = 0 
					   }
					    TriggerEvent("skinchanger:loadClothes", skin , clothesSkin)
				   end
				   SetPedArmour(PlayerPedId(), 0)
				   PlaySoundFrontend(-1, "PICK_UP", "HUD_FRONTED_DEFAULT_SOUNDSET", true)
				   ClearPedTasks(PlayerPedId())
				   menu.close()
			   end)
		  end
   end, function(data, menu)
   menu.close()
   CurrentAction = 'menu_armor'
   CurrentActionMsg = _U('open_armor')
   CurrentActionData = {}
   end)
  
end

The menu open and show take and remove but take dosen’t work not errors nothing any help remove working that is the odd

1 Like

Also I trying find a cool animation which is like repair but not really

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.