[HELP] Cutscene

Hi, I’ve been working on cutscenes for a while. I don’t consider myself an expert in scripting, but I’m trying. Anyway, I’m working on a script where is the cutscene. I see my character there and everything works as it should but I need to get rid of the other peds behind me but I don’t know how to do it. If you can help me with this problem I will be grateful.

3 Likes

Although I can not offer any help with this. Seeing this implemented into fivem would be a game-changer. Keep up the great work! Would love to see some previews even if they are buggy

1 Like

You would have to disable those peds. E.G on the Airplane cutscene the disable code would look like as following (note: this is from a mod that i made without FiveM)

  native.setCutsceneEntityStreamingFlags(character.Gender === Gender.Male ? "MP_Female_Character" : "MP_Male_Character" , 0, 1); // disable other gender
  // Unload other gender
  native.registerEntityForCutscene(0, character.Gender === Gender.Male ? "MP_Female_Character" : "MP_Male_Character" , 3, native.getHashKey(character.Gender === Gender.Male ? "mp_f_freemode_01" : "mp_m_freemode_01" ), 0);

  // Unload other characters
  for (let i = 0; i <= 7; i++) {
    native.setCutsceneEntityStreamingFlags("MP_Plane_Passenger_" + i, 0, 1);
    native.registerEntityForCutscene(0, 'MP_Plane_Passenger_' + i, 3, native.getHashKey('mp_f_freemode_01'), 0);
    native.registerEntityForCutscene(0, 'MP_Plane_Passenger_' + i, 3, native.getHashKey('mp_m_freemode_01'), 0);
  }

It’s most likely similar for yours.

1 Like

Thanks man, you helped me. It works great. :smile:

1 Like

Hi, I’m French so sorry for my low level in English.
Did you manage to adapt the above script on FiveM? I don’t succeed…

Hello, yes I did it. The only character in the cutscene is mine. I can’t say for sure that it works 100% because I only tried it on the local server.

Can you help me please ? I really search a solution…

Hi, after a lot of research and tests, I still can’t remove the other peds and make my skin appear with his clothes… I use this code:

RegisterCommand("cut", function(source, args)
    local ped = PlayerPedId()

    RequestCutscene('mp_intro_mcs_10_a2', 8) 
	
    while not (HasCutsceneLoaded()) do
        Wait(0)
    end

    SetCutsceneEntityStreamingFlags('MP_1', 0, 1)
    RegisterEntityForCutscene(ped, 'MP_1', 0, 0, 64)

    StartCutscene(0)

    while not (DoesCutsceneEntityExist('MP_1', 0)) do
        Wait(0)
    end

    SetPedComponentVariation(ped, componentId, drawableId, textureId, paletteId)

    while not (HasCutsceneFinished()) do
        Wait(0)
    end
end)

Could you please help me?

1 Like

Hi, sorry for the late reply. You forgot to add other characters and a feature to create your character in the cutscene. I hope this helps you.

local function BeginCutsceneWithPlayer()
	local plyrId = PlayerPedId()
	local playerClone = ClonePed_2(plyrId, 0.0, false, true, 1)

SetBlockingOfNonTemporaryEvents(playerClone, true)
	SetEntityVisible(playerClone, false, false)
	SetEntityInvincible(playerClone, true)
	SetEntityCollision(playerClone, false, false)
	FreezeEntityPosition(playerClone, true)
	SetPedHelmet(playerClone, false)
	RemovePedHelmet(playerClone, true)
	
	SetCutsceneEntityStreamingFlags('MP_1', 0, 1)
	RegisterEntityForCutscene(plyrId, 'MP_1', 0, GetEntityModel(plyrId), 64)

	SetCutsceneEntityStreamingFlags('MP_2', 0, 1)
	RegisterEntityForCutscene(plyrId, 'MP_2', 3, GetEntityModel(plyrId), 64)

	SetCutsceneEntityStreamingFlags('MP_3', 0, 1)
	RegisterEntityForCutscene(plyrId, 'MP_3', 3, GetEntityModel(plyrId), 64)

	SetCutsceneEntityStreamingFlags('MP_4', 0, 1)
	RegisterEntityForCutscene(plyrId, 'MP_4', 3, GetEntityModel(plyrId), 64)

	Wait(10)
	StartCutscene(0)
	Wait(10)
	ClonePedToTarget(playerClone, plyrId)
	Wait(10)
	DeleteEntity(playerClone)
  
	return playerClone
  end
3 Likes