Skip to content

Commit

Permalink
feat(client): Support for setting initial player clothes (iLLeniumStu…
Browse files Browse the repository at this point in the history
  • Loading branch information
TheiLLeniumStudios authored Jul 3, 2022
1 parent a27126a commit 9e83bbf
Show file tree
Hide file tree
Showing 2 changed files with 202 additions and 0 deletions.
5 changes: 5 additions & 0 deletions client/client.lua
Original file line number Diff line number Diff line change
Expand Up @@ -201,14 +201,19 @@ end

RegisterNetEvent('qb-clothes:client:CreateFirstCharacter', function()
QBCore.Functions.GetPlayerData(function(pd)
local gender = "Male"
local skin = 'mp_m_freemode_01'
if pd.charinfo.gender == 1 then
skin = "mp_f_freemode_01"
gender = "Female"
end
exports['fivem-appearance']:setPlayerModel(skin)
-- Fix for tattoo's appearing when creating a new character
local ped = PlayerPedId()
exports['fivem-appearance']:setPedTattoos(ped, {})
exports['fivem-appearance']:setPedComponents(ped, Config.InitialPlayerClothes[gender].Components)
exports['fivem-appearance']:setPedProps(ped, Config.InitialPlayerClothes[gender].Props)
exports['fivem-appearance']:setPedHair(ped, Config.InitialPlayerClothes[gender].Hair)
ClearPedDecorations(ped)
QBCore.Functions.TriggerCallback("QBCore:HasPermission", function(permission)
local config = getConfigForPermission(permission)
Expand Down
197 changes: 197 additions & 0 deletions shared/config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -513,3 +513,200 @@ Config.Outfits = {
}
}
}

Config.InitialPlayerClothes = {
Male = {
Components = {
{
component_id = 0, -- Face
drawable = 0,
texture = 0
},
{
component_id = 1, -- Mask
drawable = 0,
texture = 0
},
{
component_id = 2, -- Hair
drawable = 0,
texture = 0
},
{
component_id = 3, -- Upper Body
drawable = 0,
texture = 0
},
{
component_id = 4, -- Lower Body
drawable = 0,
texture = 0
},
{
component_id = 5, -- Bag
drawable = 0,
texture = 0
},
{
component_id = 6, -- Shoes
drawable = 0,
texture = 0
},
{
component_id = 7, -- Scarf & Chains
drawable = 0,
texture = 0
},
{
component_id = 8, -- Shirt
drawable = 0,
texture = 0
},
{
component_id = 9, -- Body Armor
drawable = 0,
texture = 0
},
{
component_id = 10, -- Decals
drawable = 0,
texture = 0
},
{
component_id = 11, -- Jacket
drawable = 0,
texture = 0
}
},
Props = {
{
prop_id = 0, -- Hat
drawable = -1,
texture = -1
},
{
prop_id = 1, -- Glasses
drawable = -1,
texture = -1
},
{
prop_id = 2, -- Ear
drawable = -1,
texture = -1
},
{
prop_id = 6, -- Watch
drawable = -1,
texture = -1
},
{
prop_id = 7, -- Bracelet
drawable = -1,
texture = -1
}
},
Hair = {
color = 0,
highlight = 0,
style = 0,
texture = 0
}
},
Female = {
Components = {
{
component_id = 0, -- Face
drawable = 0,
texture = 0
},
{
component_id = 1, -- Mask
drawable = 0,
texture = 0
},
{
component_id = 2, -- Hair
drawable = 0,
texture = 0
},
{
component_id = 3, -- Upper Body
drawable = 0,
texture = 0
},
{
component_id = 4, -- Lower Body
drawable = 0,
texture = 0
},
{
component_id = 5, -- Bag
drawable = 0,
texture = 0
},
{
component_id = 6, -- Shoes
drawable = 0,
texture = 0
},
{
component_id = 7, -- Scarf & Chains
drawable = 0,
texture = 0
},
{
component_id = 8, -- Shirt
drawable = 0,
texture = 0
},
{
component_id = 9, -- Body Armor
drawable = 0,
texture = 0
},
{
component_id = 10, -- Decals
drawable = 0,
texture = 0
},
{
component_id = 11, -- Jacket
drawable = 0,
texture = 0
}
},
Props = {
{
prop_id = 0, -- Hat
drawable = -1,
texture = -1
},
{
prop_id = 1, -- Glasses
drawable = -1,
texture = -1
},
{
prop_id = 2, -- Ear
drawable = -1,
texture = -1
},
{
prop_id = 6, -- Watch
drawable = -1,
texture = -1
},
{
prop_id = 7, -- Bracelet
drawable = -1,
texture = -1
}
},
Hair = {
color = 0,
highlight = 0,
style = 0,
texture = 0
}
}
}

0 comments on commit 9e83bbf

Please sign in to comment.