[Include] [N]Death Sequence - GTA 5 Style Death sequence!
#1

Hi guys! I thought myself "How about you make a small include that creates a simmilar effect to the GTA 5 death sequence". So i did! It's obviously not 100% like GTA 5, i combined the Death Style sequence with the character switching sequence from GTA 5. It's just a fun project, nothing big really but it looks so cool!

Video: https://*********/q1Bx112xPAI

Note: This Video shows a very strong camera shake which i lowered within the include, you can also disable/enable it if you want(Default: Disabled).

Note2: Video contains sound samples from the GTA 5 Game which is not included with the include! I added the sounds within the Video editor for entertaining purpose only! You will hear no sound what so ever.

Download:
https://pastebin.com/KzBAV1v2

Installation:
Write on top your Gamemode this:
Код:
#include <ndeathseq>
Now inside the callback OnPlayerDeath, add this function(Ideally at the end):
Код:
DeathSequenceInitial(playerid);
Now in OnPlayerSpawn you should make a new condition in which we put this function:
Код:
StartDeathSequence(playerid, POS_X, POS_Y, POS_Z, ROTATION)
Inside this function we put in the position where the player will spawn together with the rotation.

Now, inside the brackets we put the further code of the normal spawn of the player by Gamemode.

Explanation: StartDeathSequence returns false if the player has died and we want to enable the death sequence, from the fact that the condition is false,
the usual code will not be executed, only after completing the sequence the condition will be true because it has finished the sequence and we execute the normal spawn code.

Now inside the OnPlayerDisconnect callback we simply put this function:
Код:
DeathSequenceReset(playerid);
It's supposed to look something like this:
Код:
public OnPlayerDeath(playerid, killerid, reason)
{
	DeathSequenceInitial(playerid);
	return 1;
}

public OnPlayerSpawn(playerid)
{
	//HERE WE DO NOT GIVE ANYTHING! EVERYTHING WE PUT INSIDE THE BRACKETS OF THE FOLLOWING CONDITION!
	if(StartDeathSequence(playerid, 1064.3226,-1790.8276,13.6593, 149.5278)) //Player spawn, the same coordinates as below
	{
		//REST OF YOUR CODE!
		SetPlayerPos(playerid, 1064.3226,-1790.8276,13.6593); //Player Spawn
		SetPlayerFacingAngle(playerid, 149.5278);
		SetCameraBehindPlayer(playerid);
	}
	//HERE WE DO NOT GIVE ANYTHING! EVERYTHING, EVERYTHING WE PUT INSIDE THE BRACKETS OF THE ABOVE CONDITION!
	return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
	DeathSequenceReset(playerid);
	return 1;
}
End Note:
I have not tested it within my RP Server! I don't know how it will work within a bigger Gamemode, i have tested it on my Test server which contains only a few lines of code... It's a fun project, i made it in about 15 minutes or so.

Well... ENJOY!
Reply


Messages In This Thread
[N]Death Sequence - GTA 5 Style Death sequence! - by Nickk888 - 27.04.2018, 20:47
Re: [N]Death Sequence - GTA 5 Style Death sequence! - by Dancsika - 17.05.2018, 13:53
Re: [N]Death Sequence - GTA 5 Style Death sequence! - by Pottus - 17.05.2018, 17:16
Re: [N]Death Sequence - GTA 5 Style Death sequence! - by dani18 - 17.05.2018, 19:49
Re: [N]Death Sequence - GTA 5 Style Death sequence! - by RogueDrifter - 18.05.2018, 08:48

Forum Jump:


Users browsing this thread: 3 Guest(s)