Just save the clothes you have before you run the cutscene. like this:
So. this should work. but for some reason i need â â â to the script work. Mayby just a mistake on forum.cfx (idk) if for some reason it donât work itâs properly the reason.
local ped = PlayerPedId()
RequestCutscene("heist_int", 8)
while not (HasCutsceneLoaded()) do
Wait(0)
RequestCutscene("heist_int", 8)
end
TriggerEvent('save_all_clothes') -- saves the clothes
-- Sets current player ped as cutscene mp ped.
SetCutsceneEntityStreamingFlags('MP_1', 0, 1)
RegisterEntityForCutscene(ped, 'MP_1', 0, 0, 64)
StartCutscene(0)
-- Waiting for the cutscene to spawn the mp ped.
while not (DoesCutsceneEntityExist('MP_1', 0)) do
Wait(0)
end
-- Set the clothes that you had on ped ' <-- for some reason that is needed to comment.
SetCutscenePedComponentVariationFromPed(PlayerPedId(), GetPlayerPed(-1), 1885233650)
SetPedComponentVariation(GetPlayerPed(-1), 11, jacket_old, jacket_tex, jacket_pal)
SetPedComponentVariation(GetPlayerPed(-1), 8, shirt_old, shirt_tex, shirt_pal)
SetPedComponentVariation(GetPlayerPed(-1), 3, arms_old, arms_tex, arms_pal)
SetPedComponentVariation(GetPlayerPed(-1), 4, pants_old,pants_tex,pants_pal)
SetPedComponentVariation(GetPlayerPed(-1), 6, feet_old,feet_tex,feet_pal)
SetPedComponentVariation(GetPlayerPed(-1), 1, mask_old,mask_tex,mask_pal)
SetPedComponentVariation(GetPlayerPed(-1), 9, vest_old,vest_tex,vest_pal)
SetPedPropIndex(GetPlayerPed(-1), 0, hat_prop, hat_tex, 0)
SetPedPropIndex(GetPlayerPed(-1), 1, glass_prop, glass_tex, 0)
while not (HasCutsceneFinished()) do
Wait(0)
end
-- after the funtion end.
RegisterNetEvent('save_all_clothes') -- The actual saving.
AddEventHandler('save_all_clothes',function()
local ped = GetPlayerPed(-1)
mask_old,mask_tex,mask_pal = GetPedDrawableVariation(ped,1),GetPedTextureVariation(ped,1),GetPedPaletteVariation(ped,1)
vest_old,vest_tex,vest_pal = GetPedDrawableVariation(ped,9),GetPedTextureVariation(ped,9),GetPedPaletteVariation(ped,9)
glass_prop,glass_tex = GetPedPropIndex(ped,1),GetPedPropTextureIndex(ped,1)
hat_prop,hat_tex = GetPedPropIndex(ped,0),GetPedPropTextureIndex(ped,0)
jacket_old,jacket_tex,jacket_pal = GetPedDrawableVariation(ped, 11),GetPedTextureVariation(ped,11),GetPedPaletteVariation(ped,11)
shirt_old,shirt_tex,shirt_pal = GetPedDrawableVariation(ped,8),GetPedTextureVariation(ped,8),GetPedPaletteVariation(ped,8)
arms_old,arms_tex,arms_pal = GetPedDrawableVariation(ped,3),GetPedTextureVariation(ped,3),GetPedPaletteVariation(ped,3)
pants_old,pants_tex,pants_pal = GetPedDrawableVariation(ped,4),GetPedTextureVariation(ped,4),GetPedPaletteVariation(ped,4)
feet_old,feet_tex,feet_pal = GetPedDrawableVariation(ped,6),GetPedTextureVariation(ped,6),GetPedPaletteVariation(ped,6)
end)