tweak: move clothing menu command to core

This commit is contained in:
Andyyy7666
2024-02-25 23:54:10 +01:00
parent 9d4708a1f8
commit 3252118f93
2 changed files with 26 additions and 0 deletions

View File

@@ -50,3 +50,22 @@ RegisterNetEvent("ND:revivePlayer", function()
end) end)
RegisterNetEvent("ND:characterUnloaded") RegisterNetEvent("ND:characterUnloaded")
RegisterNetEvent("ND:clothingMenu", function()
if GetResourceState("fivem-appearance") ~= "started" then return end
local function customize(appearance)
if not appearance then return end
TriggerServerEvent("ND:updateClothing", appearance)
end
exports["fivem-appearance"]:startPlayerCustomization(customize, {
ped = false,
headBlend = true,
faceFeatures = true,
headOverlays = true,
components = true,
props = true,
tattoos = true
})
end)

View File

@@ -154,3 +154,10 @@ RegisterNetEvent("ND:playerEliminated", function(info)
deathInfo = info deathInfo = info
}) })
end) end)
RegisterNetEvent("ND::updateClothing", function(clothing)
local src = source
local player = NDCore.getPlayer(src)
if not player or not clothing or type(clothing) ~= "table" then return end
player.setMetadata("clothing", clothing)
end)