Log in to reply
 

[C++] Mission Passed Scaleform Movie



  • Hy. I was searching the Mission Passed scaleform Move, but i didn't found!
    Anybody who help me?
    (Bad english)
    Thank you! :)



  • @Tarack What do you mean mean?



  • The Mission Passed scaleform move. You know, Mission Passed, gold medal in the screen .... :)



  • 0_1490447712414_468px-GTAV.PS4.1080P.347.jpg
    I mean this.



  • Anybody who knows?


  • MODERATOR

    This is (mostly) how R*'s scripts do it (untested):

    const uint PLAYER_ZERO = 0xD7114C9;
    const uint PLAYER_ONE = 0x9B22DBAF;
    const uint PLAYER_TWO = 0x9B810FA2;
    
    int missionCompletedScaleform;
    int timeStopDrawing = 0;
    
    int getPlayerNum()
    {
    	switch (ENTITY::GET_ENTITY_MODEL(PLAYER::PLAYER_PED_ID()))
    	{
    	case PLAYER_ZERO:
    		return 0;
    	case PLAYER_ONE:
    		return 1;
    	case PLAYER_TWO:
    		return 2;
    	}
    
    	return -1;
    }
    
    void playMissionCompleteSound(int audioSize)
    {
    	char* audioName;
    
    	AUDIO::REGISTER_SCRIPT_WITH_AUDIO(0);
    
    	switch (getPlayerNum())
    	{
    	case 0:
    		if (audioSize)
    		{
    			audioName = "MICHAEL_SMALL_01";
    		}
    		else
    		{
    			audioName = "MICHAEL_BIG_01";
    		}
    		break;
    
    	case 1:
    		if (audioSize)
    		{
    			audioName = "FRANKLIN_SMALL_01";
    		}
    		else
    		{
    			audioName = "FRANKLIN_BIG_01";
    		}
    		break;
    
    	case 2:
    		if (audioSize)
    		{
    			audioName = "TREVOR_SMALL_01";
    		}
    		else
    		{
    			audioName = "TREVOR_BIG_01";
    		}
    		break;
    	}
    
    	AUDIO::PLAY_MISSION_COMPLETE_AUDIO(audioName);
    }
    
    void doScaleformTextCommand(char* textCommand)
    {
    	GRAPHICS::_BEGIN_TEXT_COMMAND_SCALEFORM(textCommand);
    	GRAPHICS::_END_TEXT_COMMAND_SCALEFORM();
    }
    
    void showMissionCompleted()
    {
    	missionCompletedScaleform = GRAPHICS::REQUEST_SCALEFORM_MOVIE("MP_BIG_MESSAGE_FREEMODE");
    
    	if (GRAPHICS::HAS_SCALEFORM_MOVIE_LOADED(missionCompletedScaleform))
    	{
    		GRAPHICS::_PUSH_SCALEFORM_MOVIE_FUNCTION(missionCompletedScaleform, "SHOW_MISSION_PASSED_MESSAGE");
    		doScaleformTextCommand("M_FB4P3_P"); //not sure what these two do
    		doScaleformTextCommand("M_FB4P3");
    		GRAPHICS::_PUSH_SCALEFORM_MOVIE_FUNCTION_PARAMETER_INT(100);
    		GRAPHICS::_PUSH_SCALEFORM_MOVIE_FUNCTION_PARAMETER_BOOL(true);
    		GRAPHICS::_PUSH_SCALEFORM_MOVIE_FUNCTION_PARAMETER_INT(0);
    		GRAPHICS::_PUSH_SCALEFORM_MOVIE_FUNCTION_PARAMETER_BOOL(true);
    		GRAPHICS::_POP_SCALEFORM_MOVIE_FUNCTION_VOID();
    		playMissionCompleteSound(0);
    
    		timeStopDrawing = GAMEPLAY::GET_GAME_TIMER();
    	}
    }
    
    void stopMissionCompleted()
    {
    	timeStopDrawing = 0;
    
    	if (GRAPHICS::HAS_SCALEFORM_MOVIE_LOADED(missionCompletedScaleform))
    	{
    		GRAPHICS::SET_SCALEFORM_MOVIE_AS_NO_LONGER_NEEDED(&missionCompletedScaleform);
    	}
    }
    
    //call this in a tick
    void drawMissionCompleted()
    {
    	if (GRAPHICS::HAS_SCALEFORM_MOVIE_LOADED(missionCompletedScaleform) && AUDIO::_0x6F259F82D873B8B8()) //no idea what the audio function does
    	{
    		if (GAMEPLAY::GET_GAME_TIMER() < timeStopDrawing)
    		{
    			GRAPHICS::DRAW_SCALEFORM_MOVIE(missionCompletedScaleform, 0.5f, 0.3f, 1.0f, 1.0f, 255, 255, 255, 255, 0);
    		}
    		else if (GAMEPLAY::GET_GAME_TIMER() < timeStopDrawing + 100)
    		{
    			GRAPHICS::_PUSH_SCALEFORM_MOVIE_FUNCTION(missionCompletedScaleform, "TRANSITION_OUT");
    			GRAPHICS::_POP_SCALEFORM_MOVIE_FUNCTION_VOID();
    			timeStopDrawing = (timeStopDrawing - 100);
    		}
    		else if (GAMEPLAY::GET_GAME_TIMER() < timeStopDrawing + 500)
    		{
    			GRAPHICS::DRAW_SCALEFORM_MOVIE(missionCompletedScaleform, 0.5f, 0.3f, 1.0f, 1.0f, 255, 255, 255, 255, 0);
    		}
    		else
    		{
    			stopMissionCompleted();
    		}
    	}
    }
    

    you can also browse this code by CamxxCore to see how he did it https://github.com/CamxxCore/DriftHUD/blob/master/GTAV_DriftHUD/DriftHUD/DriftHUD.cs



  • Its working, but i cant add missión name. i only can add the missión passed text :) (The big Text)


Log in to reply
 

Looks like your connection to GTA5-Mods.com Forums was lost, please wait while we try to reconnect.