Skip to content

Commit 3252118

Browse files
committed
tweak: move clothing menu command to core
1 parent 9d4708a commit 3252118

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed

client/events.lua

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,3 +50,22 @@ RegisterNetEvent("ND:revivePlayer", function()
5050
end)
5151

5252
RegisterNetEvent("ND:characterUnloaded")
53+
54+
RegisterNetEvent("ND:clothingMenu", function()
55+
if GetResourceState("fivem-appearance") ~= "started" then return end
56+
57+
local function customize(appearance)
58+
if not appearance then return end
59+
TriggerServerEvent("ND:updateClothing", appearance)
60+
end
61+
62+
exports["fivem-appearance"]:startPlayerCustomization(customize, {
63+
ped = false,
64+
headBlend = true,
65+
faceFeatures = true,
66+
headOverlays = true,
67+
components = true,
68+
props = true,
69+
tattoos = true
70+
})
71+
end)

server/main.lua

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,3 +154,10 @@ RegisterNetEvent("ND:playerEliminated", function(info)
154154
deathInfo = info
155155
})
156156
end)
157+
158+
RegisterNetEvent("ND::updateClothing", function(clothing)
159+
local src = source
160+
local player = NDCore.getPlayer(src)
161+
if not player or not clothing or type(clothing) ~= "table" then return end
162+
player.setMetadata("clothing", clothing)
163+
end)

0 commit comments

Comments
 (0)