hi guys . i have army job on my server . im want add skin to army skins now i have 2 skins
first: citizen_wear
two :army_wear but this skin like police swat im wana change this
ESX.UI.Menu.CloseAll()
if Config.EnableNonFreemodePeds then
table.insert(elements, {label = _U(‘army_wear’), value = ‘army_wear’})
table.insert(elements, {label = _U(‘army_wear’), value = ‘army_wear’})
end
ESX.UI.Menu.Open(
'default', GetCurrentResourceName(), 'cloakroom',
{
title = _U('cloakroom'),
align = 'top-left',
elements = elements,
},
function(data, menu)
menu.close()
--Taken from SuperCoolNinja
if data.current.value == 'citizen_wear' then
ESX.TriggerServerCallback('esx_skin:getPlayerSkin', function(skin, jobSkin)
local model = nil
if skin.sex == 0 then
model = GetHashKey("mp_m_freemode_01")
else
model = GetHashKey("mp_m_freemode_01")
end
RequestModel(model)
while not HasModelLoaded(model) do
RequestModel(model)
Citizen.Wait(1)
end
SetPlayerModel(PlayerId(), model)
SetModelAsNoLongerNeeded(model)
TriggerEvent('skinchanger:loadSkin', skin)
TriggerEvent('esx:restoreLoadout')
end)
end
if data.current.value == 'army_wear' then
ESX.TriggerServerCallback('esx_skin:getPlayerSkin', function(skin, jobSkin)
if skin.sex == 0 then
TriggerEvent('skinchanger:loadClothes', skin, jobSkin.skin_male)
else
TriggerEvent('skinchanger:loadClothes', skin, jobSkin.skin_female)
end
end)
end
if data.current.value == 'army_wear' then
ESX.TriggerServerCallback('esx_skin:getPlayerSkin', function(skin, jobSkin)
if skin.sex == 0 then
local model = GetHashKey("Marine03SMY")
RequestModel(model)
while not HasModelLoaded(model) do
RequestModel(model)
Citizen.Wait(0)
end
SetPlayerModel(PlayerId(), model)
SetModelAsNoLongerNeeded(model)
else
local model = GetHashKey("Marine03SMY")
RequestModel(model)
while not HasModelLoaded(model) do
RequestModel(model)
Citizen.Wait(0)
end
SetPlayerModel(PlayerId(), model)
SetModelAsNoLongerNeeded(model)
end
end)
end
if data.current.value == 'army_wear' then
TriggerServerEvent("player:serviceOn", "police")
ESX.TriggerServerCallback('esx_skin:getPlayerSkin', function(skin, jobSkin)
if skin.sex == 0 then
SetPedComponentVariation(GetPlayerPed(-1), 7, 0, 0, 2) -- retrait cravate
SetPedComponentVariation(GetPlayerPed(-1), 10, 0, 0, 2) -- retrait grade
SetPedPropIndex(GetPlayerPed(-1), 1, 0, 0, 1) -- lunette
SetPedComponentVariation(GetPlayerPed(-1), 11, 23, 0, 2) -- Chemise Police
SetPedComponentVariation(GetPlayerPed(-1), 8, 15, 0, 2) -- Ceinture+matraque Police
SetPedComponentVariation(GetPlayerPed(-1), 4, 34, 0, 2) -- Pantalon Police
SetPedComponentVariation(GetPlayerPed(-1), 6, 25, 0, 2) -- Chaussure Police
SetPedComponentVariation(GetPlayerPed(-1), 3, 17, 0, 2) -- under skin
SetPedComponentVariation(GetPlayerPed(-1), 9, 16, 2, 2) -- parballes
SetPedComponentVariation(GetPlayerPed(-1), 1, 10, 0, 0) -- Mask
SetPedPropIndex(GetPlayerPed(-1), 0, 39,0, 0) -- casque
SetPedArmour(GetPlayerPed(-1), 100) -- Ajout armure
end
end)
end
if data.current.value == 'army_wear' then
TriggerServerEvent("player:serviceOn", "police")
ESX.TriggerServerCallback('esx_skin:getPlayerSkin', function(skin, jobSkin)
if skin.sex == 1 then
SetPedComponentVariation(GetPlayerPed(-1), 7, 0, 0, 2) -- retrait cravate
SetPedComponentVariation(GetPlayerPed(-1), 10, 0, 0, 2) -- retrait grade
SetPedPropIndex(GetPlayerPed(-1), 1, 5, 3, 2) -- lunette femme
SetPedComponentVariation(GetPlayerPed(-1), 11, 42, 0, 2) -- Chemise Police
SetPedComponentVariation(GetPlayerPed(-1), 8, 15, 0, 2) -- Ceinture+matraque Police
SetPedComponentVariation(GetPlayerPed(-1), 4, 33, 0, 2) -- Pantalon Police
SetPedComponentVariation(GetPlayerPed(-1), 6, 25, 0, 2) -- Chaussure Police
SetPedComponentVariation(GetPlayerPed(-1), 3, 18, 0, 2) -- under skin
SetPedComponentVariation(GetPlayerPed(-1), 9, 18, 2, 2) -- parballe
SetPedComponentVariation(GetPlayerPed(-1), 1, 52, 0, 2) -- Mask
SetPedPropIndex(GetPlayerPed(-1), 0, 38,0, 0) -- casque
SetPedArmour(GetPlayerPed(-1), 100) -- Ajout armure
end
end)
end
if data.current.value == 'army_wear' then
TriggerServerEvent("player:serviceOn", "police")
ESX.TriggerServerCallback('esx_skin:getPlayerSkin', function(skin, jobSkin)
if skin.sex == 0 then
SetPedComponentVariation(GetPlayerPed(-1), 7, 0, 0, 2) -- retrait cravate
SetPedComponentVariation(GetPlayerPed(-1), 10, 0, 0, 2) -- retrait grade
SetPedPropIndex(GetPlayerPed(-1), 1, 0, 0, 1) -- lunette
SetPedComponentVariation(GetPlayerPed(-1), 11, 49, 0, 2) -- Chemise Police
SetPedComponentVariation(GetPlayerPed(-1), 8, 15, 0, 2) -- Ceinture+matraque Police
SetPedComponentVariation(GetPlayerPed(-1), 4, 34, 0, 2) -- Pantalon Police
SetPedComponentVariation(GetPlayerPed(-1), 6, 25, 0, 2) -- Chaussure Police
SetPedComponentVariation(GetPlayerPed(-1), 3, 17, 0, 2) -- under skin
SetPedComponentVariation(GetPlayerPed(-1), 9, 16, 2, 2) -- parballes
SetPedComponentVariation(GetPlayerPed(-1), 1, 52, 0, 0) -- Mask
SetPedPropIndex(GetPlayerPed(-1), 0, 39,0, 0) -- casque
SetPedArmour(GetPlayerPed(-1), 100) -- Ajout armure
end
end)
end
if data.current.value == 'army_wear' then
TriggerServerEvent("player:serviceOn", "police")
ESX.TriggerServerCallback('esx_skin:getPlayerSkin', function(skin, jobSkin)
if skin.sex == 1 then
SetPedComponentVariation(GetPlayerPed(-1), 7, 0, 0, 2) -- retrait cravate
SetPedComponentVariation(GetPlayerPed(-1), 10, 0, 0, 2) -- retrait grade
SetPedPropIndex(GetPlayerPed(-1), 1, 5, 3, 2) -- lunette femme
SetPedComponentVariation(GetPlayerPed(-1), 11, 42, 0, 2) -- Chemise Police
SetPedComponentVariation(GetPlayerPed(-1), 8, 15, 0, 2) -- Ceinture+matraque Police
SetPedComponentVariation(GetPlayerPed(-1), 4, 33, 0, 2) -- Pantalon Police
SetPedComponentVariation(GetPlayerPed(-1), 6, 25, 0, 2) -- Chaussure Police
SetPedComponentVariation(GetPlayerPed(-1), 3, 18, 0, 2) -- under skin
SetPedComponentVariation(GetPlayerPed(-1), 9, 18, 2, 2) -- parballe
SetPedComponentVariation(GetPlayerPed(-1), 1, 52, 0, 2) -- Mask
SetPedPropIndex(GetPlayerPed(-1), 0, 38,0, 0) -- casque
SetPedArmour(GetPlayerPed(-1), 100) -- Ajout armure
end
end)
end