menper
February 11, 2022, 9:06pm
1
Hello I have a problem with my script allows me to give an outfit to the policeman with men my outfit works but with women no it does something completely different :
When a male take the outfits
And when a female take it :
This is my code for rage UI
I would like a solution that allows me to solve this problem or a way to create 2 different outfits for men and women
Thanks you
Have a good day
vomcore
February 12, 2022, 10:54pm
2
if im understanding right im pretty sure you’d have to make sure the female and male clothing options you want are in the exact same slots across both, if you don’t want to do two?
(example, if the police shirt for MP male is slot 8, texture 15, then the police shirt for MP female would also need to be slot 8, texture 15)
1 Like
This happens because male and female are different. You need to gather the correct slots and apply them, so basically “if mp male, apply these, if mp female, apply these ”
1 Like
AvaN0x
February 13, 2022, 7:35am
4
Yes, values code are not the same on male and female.
There are multiple ways this can be done :
if IsPedMale(PlayerPedId()) then
-- male skin
else
-- female skin
end
if GetEntityModel(PlayerPedId()) == `mp_m_freemode_01` then
-- male skin
else
-- female skin
end
Using esx_skin (as I see above that you’re using it)
ESX.TriggerServerCallback('esx_skin:getPlayerSkin', function(skin, jobSkin)
if skin.sex == 0 then
-- male skin
else
-- female skin
end
end)
There could more ways, but you can choose one of these above.
1 Like
menper
February 18, 2022, 8:43pm
5
Im gonna test this thanks
menper
February 18, 2022, 9:34pm
6
So i found the solution
local hash = GetEntityModel(PlayerPedId())
if hash == `mp_m_freemode_01` then
SetPedComponentVariation(GetPlayerPed(-1) , 8, 15, 0) --tshirt
SetPedComponentVariation(GetPlayerPed(-1) , 11, 55, 0) --torse
SetPedComponentVariation(GetPlayerPed(-1) , 3, 0, 0) --bras
SetPedComponentVariation(GetPlayerPed(-1) , 4, 24, 0) --pants
SetPedComponentVariation(GetPlayerPed(-1) , 6, 25, 0) --shoes
SetPedComponentVariation(GetPlayerPed(-1) , 0, 3, 0) --mask
else
SetPedComponentVariation(GetPlayerPed(-1) , 8, 15, 0) --tshirt
SetPedComponentVariation(GetPlayerPed(-1) , 11, 24, 0) --torse
SetPedComponentVariation(GetPlayerPed(-1) , 3, 0, 0) --bras
SetPedComponentVariation(GetPlayerPed(-1) , 4, 24, 0) --pants
SetPedComponentVariation(GetPlayerPed(-1) , 6, 25, 0) --shoes
SetPedComponentVariation(GetPlayerPed(-1) , 0, 3, 0) --mask
end
Thanks you for all the help fivem has a great comunity thanks a lot
3 Likes
menper:
local hash = GetEntityModel(PlayerPedId())
if hash == `mp_m_freemode_01` then
SetPedComponentVariation(GetPlayerPed(-1) , 8, 15, 0) --tshirt
SetPedComponentVariation(GetPlayerPed(-1) , 11, 55, 0) --torse
SetPedComponentVariation(GetPlayerPed(-1) , 3, 0, 0) --bras
SetPedComponentVariation(GetPlayerPed(-1) , 4, 24, 0) --pants
SetPedComponentVariation(GetPlayerPed(-1) , 6, 25, 0) --shoes
SetPedComponentVariation(GetPlayerPed(-1) , 0, 3, 0) --mask
else
SetPedComponentVariation(GetPlayerPed(-1) , 8, 15, 0) --tshirt
SetPedComponentVariation(GetPlayerPed(-1) , 11, 24, 0) --torse
SetPedComponentVariation(GetPlayerPed(-1) , 3, 0, 0) --bras
SetPedComponentVariation(GetPlayerPed(-1) , 4, 24, 0) --pants
SetPedComponentVariation(GetPlayerPed(-1) , 6, 25, 0) --shoes
SetPedComponentVariation(GetPlayerPed(-1) , 0, 3, 0) --mask
end
where do i add this please as tried where i thought it would go and didnt work?