Skip to content

Commit

Permalink
fix(client): Fix invisible when load skin and citizenid blacklisting …
Browse files Browse the repository at this point in the history
…for peds (#257)

* add(config): add default skin for invisible

* feat(esx/compat): fix load skin when invisible

* feat(game/custom): add ped blacklist access for citizenids

* Revert "add(config): add default skin for invisible"

This reverts commit 1483d0e.

* feat(esx/compat): fix load skin when invisible

* feat(game/custom): fix missing condition

* Revert "feat(esx/compat): fix load skin when invisible"

This reverts commit b551088.

* feat(esx/compat): fix load skin when invisible
  • Loading branch information
nurrifqialhusaini authored Feb 20, 2023
1 parent cb6791c commit 980f511
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
13 changes: 11 additions & 2 deletions client/framework/esx/compatibility.lua
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,19 @@ RegisterNetEvent("skinchanger:getSkin", function(cb)
end)

RegisterNetEvent("skinchanger:loadSkin", function(skin, cb)
if not skin.hair_1 then
-- add validation invisible when failed registration (maybe server restarted when apply skin)
if skin.model then
client.setPlayerAppearance(skin)
Framework.CachePed()
else
local data = Config.InitialPlayerClothes[Framework.GetGender(true)]
if Framework.GetGender(true) == "Male" then
data.model = 'mp_m_freemode_01'
else
data.model = 'mp_f_freemode_01'
end
client.setPlayerAppearance(data)
end
Framework.CachePed()
if cb ~= nil then
cb()
end
Expand Down
2 changes: 1 addition & 1 deletion game/customization.lua
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ local function filterPedModelsForPlayer(pedConfigs)

for i = 1, #pedConfigs do
local config = pedConfigs[i]
if (not config.jobs and not config.gangs and not config.aces) or allowedForPlayer(config, allowedAces) then
if (not config.jobs and not config.gangs and not config.aces and not config.citizenids) or allowedForPlayer(config, allowedAces) then
for j = 1, #config.peds do
playerPeds[#playerPeds + 1] = config.peds[j]
end
Expand Down

0 comments on commit 980f511

Please sign in to comment.