Removing saved clothes

Credits to Eden server
This commit is contained in:
LuaDeldu
2017-12-01 20:20:45 +01:00
parent 2d7485a6d2
commit f5bfd82d75
4 changed files with 55 additions and 0 deletions
+28
View File
@@ -514,6 +514,7 @@ function OpenRoomMenu(property, owner)
if CurrentPropertyOwner == owner then
table.insert(elements, {label = _U('player_clothes'), value = 'player_dressing'})
table.insert(elements, {label = _U('remove_cloth'), value = 'remove_cloth'})
end
table.insert(elements, {label = _U('remove_object'), value = 'room_inventory'})
@@ -602,6 +603,33 @@ function OpenRoomMenu(property, owner)
end)
end
if data.current.value == 'remove_cloth' then
ESX.TriggerServerCallback('esx_property:getPlayerDressing', function(dressing)
local elements = {}
for i=1, #dressing, 1 do
table.insert(elements, {label = dressing[i].label, value = i})
end
ESX.UI.Menu.Open(
'default', GetCurrentResourceName(), 'remove_cloth',
{
title = property.label .. ' - ' .. _U('remove_cloth'),
align = 'top-left',
elements = elements,
},
function(data, menu)
menu.close()
TriggerServerEvent('esx_property:removeOutfit', data.current.value)
ESX.ShowNotification(_U('removed_cloth'))
end,
function(data, menu)
menu.close()
end
)
end)
end
if data.current.value == 'room_inventory' then
OpenRoomInventoryMenu(property, owner)