27.04.2018, 20:47
(
Последний раз редактировалось Nickk888; 22.05.2018 в 22:26.
)
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:
Now inside the callback OnPlayerDeath, add this function(Ideally at the end):
Now in OnPlayerSpawn you should make a new condition in which we put this function:
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:
It's supposed to look something like this:
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!
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>
Код:
DeathSequenceInitial(playerid);
Код:
StartDeathSequence(playerid, POS_X, POS_Y, POS_Z, 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);
Код:
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; }
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!