Files
community_bridge/modules/clothing/illenium-appearance/client.lua
T

42 lines
1.5 KiB
Lua
Raw Normal View History

2025-01-08 06:33:31 -05:00
if GetResourceState('illenium-appearance') ~= 'started' then return end
Clothing = Clothing or {}
2025-01-08 06:33:31 -05:00
Clothing.SetAppearance = function(clothingData)
local clothing = {}
if GetEntityModel(cache.ped) == `mp_m_freemode_01` then
clothingData = clothingData.male
else
clothingData = clothingData.female
end
clothing.components = exports['illenium-appearance']:getPedComponents(cache.ped)
clothing.props = exports['illenium-appearance']:getPedProps(cache.ped)
2025-01-09 03:55:10 -05:00
Prints.Debug(json.encode(clothingData, {indent = true}))
2025-02-06 23:33:31 -05:00
ClothingBackup = clothing
2025-01-08 06:33:31 -05:00
exports['illenium-appearance']:setPedComponents(cache.ped, clothingData.components)
exports['illenium-appearance']:setPedProp(cache.ped, clothingData.props)
return true
end
Clothing.GetAppearance = function()
local clothing = {}
if GetEntityModel(cache.ped) == `mp_m_freemode_01` then
clothing = clothing.male
else
clothing = clothing.female
end
clothing.components = exports['illenium-appearance']:getPedComponents(cache.ped)
clothing.props = exports['illenium-appearance']:getPedProps(cache.ped)
return clothing
end
Clothing.RestoreAppearance = function()
2025-02-06 23:33:31 -05:00
exports['illenium-appearance']:setPedComponents(cache.ped, ClothingBackup.components)
exports['illenium-appearance']:setPedProp(cache.ped, ClothingBackup.props)
2025-01-08 06:33:31 -05:00
return true
end
Clothing.ReloadSkin = function()
TriggerEvent("illenium-appearance:client:reloadSkin", true)
end