Jump to content

Dramatic Suicide Script


Donnovan

Recommended Posts

I like to say thankyou to Grafzahl for the Suicide Script.

 

I made is happens faster, and more dramatic.

 

Aditional info:

 

- Player scream sound is in-world and can be heard by other players and zombies.

- The gun shot sound, for the player, is the normal gun *ploc* and a personal dramatic gun shot that is not heard in-world. The others just listem the abitual gun *ploc*.

 

https://www.youtube.com/watch?v=PkoWgPlTDWg

Link to comment
Share on other sites

I was working in my personal Pocket Bike Script:

 

Still missing on the Dramatic Suicide Script:

 

1) If player is crouched or proned, there is a out of sync beteween sounds and animation, because the player firstly need to stand up.

 

Solution: Check if the player is stand up befor offer the suicide option.

Know  how to do?: No, but i believe its a simple check like the "_CanDo" check "If (_CanDo) Then {...}"

 

Not sure if player scream can atract zombies:

 

2) Solution: use a piece of code from Player2/cen bike script that alert zombies in a x meters radius (x will be 35).

Know how to do?: Yes.

 

Will try to solve that now.

Link to comment
Share on other sites

I was working in my personal Pocket Bike Script:

 

Still missing on the Dramatic Suicide Script:

 

1) If player is crouched or proned, there is a out of sync beteween sounds and animation, because the player firstly need to stand up.

 

Solution: Check if the player is stand up befor offer the suicide option.

Know  how to do?: No, but i believe its a simple check loke the "_CanDo" check "If (_CanDo) Then {...}"

 

Not sure if player scream can atract zombies:

 

2) Solution: use a piece of code from Player2/cen bike script that alert zombies in a x meters radius (x will be 35).

Know how to do?: Yes.

 

Will try to solve that now.

Send me the script I add that 

Link to comment
Share on other sites

This goes in your custom fn_selfActions.sqf:

This is the avaliable options "Retire from Life" and "Confirm Retire from Life!" for the player self actions, that appears when you scrool the mouse wheel.

private ["_handGun"];
_handGun = currentWeapon player;
if ((_handGun in ["glock17_EP1","M9","M9SD","Makarov","MakarovSD","revolver_EP1","UZI_EP1","Sa61_EP1","Colt1911"]) && (player ammo _handGun > 0) && canStand player && (speed player <= 1) && _canDo) then {
	if ((is_confirmation == 0) && (s_player_suicide < 0)) then {
		name_on_menu = "<t color=""#303030"">Retire from Life</t>";
		s_player_suicide = player addaction[(name_on_menu),"custom\suicide.sqf",_handGun,0,false,true,"", ""];
	};
	if ((is_confirmation == 1) && (s_player_suicide_confirm < 0)) then {
		name_on_menu = "<t color=""#d00020"">Confirm Retire from Life!</t>";
		s_player_suicide_confirm = player addaction[(name_on_menu),"custom\suicide.sqf",_handGun,0,false,true,"", ""];
	};
} else {
	if (is_confirmation == 0) then {
		player removeAction s_player_suicide;
	};
	if (is_confirmation == 1) then {
		player removeAction s_player_suicide_confirm;
	};
	s_player_suicide = -1;
	s_player_suicide_confirm = -1;
	is_confirmation = 0;
};
This goes in a new file with the name suicide.sqf in the folder YourMissionFolder/custom/suicide.sqf:

This is the file that plays the suicide animation and sounds.

if (is_confirmation == 0) then {
	player removeAction s_player_suicide;
	is_confirmation = 1;
	cutText [format["Please, confirm Retire."], "PLAIN DOWN"];
} else {
	is_confirmation = 0;
	
	_state = (getText (configFile >> "CfgMovesMaleSdr" >> "States" >> animationState player >> "actions"));

	if (_state in ["RifleProneActions","PistolProneActions","CivilProneActions"]) then {
		player playAction "PlayerStand";
		sleep 2;
	};
	if (_state in ["RifleKneelActions","PistolKneelActions","CivilKneelActions"]) then {
		player playAction "PlayerStand";
		sleep 1;
	};

	player addEventHandler ["fired", {player SetDamage 0.9; playSound "finalShot";}];

	player playmove "ActsPercMstpSnonWpstDnon_suicide1B";

	_sfx="madIncoming";
	_nul = [objNull, player, rSAY, _sfx] call RE;

	sleep 6.8;

	_dis=35;
	_sfx="dieScream";
	_nul = [objNull, player, rSAY, _sfx] call RE;
	[player,_dis,true,(getPosATL player)] spawn player_alertZombies;

	sleep 1.6;
	player fire currentWeapon player;
	sleep 0.5;
	player SetDamage 1.0;
};
This goes in the file description.ext in the folder YourMissionFolder/description.ext:

Those are the 3 sounds declaration, and if you already have declared sounds in description.ext, you need to add those 3 sound along with the ones you already have there.

class CfgSounds
{
    sounds[] = {dieScream, finalShot, madIncoming};

    class dieScream {
		name="dieScream";
		sound[]={diescream.ogg,0.8,1};
		titles[] = {};
    };
    class madIncoming {
		name="madIncoming";
		sound[]={madincoming.ogg,0.8,1};
		titles[] = {};
    };
    class finalShot {
		name="finalShot";
		sound[]={finalshot.ogg,0.8,1};
		titles[] = {};
    };
};

The 3 ogg sounds files in the link bellow must be put in the folder YourMissionFolder:

 

Get the 3 sounds here: Sounds on Tinyupload.com

 

They are diescream.ogg, madincoming.ogg and finalshot.ogg.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement
  • Discord

×
×
  • Create New...