Karmafied

Paying for a *working* custom anti-death/delirium script

26 posts in this topic

Advertisement
On 11/24/2015 at 8:29 PM, Karmafied said:

Would anyone know how to make explosions (and headshots as a bonus) insta-kill instead of activating the delirium?

Anything on this yet?

 

If this would work with explosives and head shots being insta-deaths then the script would be absolutely perfect. Would love to see it.

Share this post


Link to post
Share on other sites

@Xtortion

This will kill the player if the source of damage (type of projectile) is in the defined list. You can add / remove explosive types

Spoiler

/**
 * Exile Mod
 * www.exilemod.com
 * © 2015 Exile Mod Team
 *
 * This work is licensed under the Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License. 
 * To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/.
 */
 
private["_unit","_selectionName","_amountOfDamage","_sourceOfDamage","_typeOfProjectile"];
_unit             = _this select 0;
_selectionName    = _this select 1;
_amountOfDamage   = _this select 2;
_sourceOfDamage   = _this select 3;
_typeOfProjectile = _this select 4;

_isDeliriumActive = true;
_neededDamageToActivateDelirium = 0.98;
deliriumMinutes  = 1;
minimumDamageToRestoreFromDeliriumStatus = 0.85;
restoreFullHealthAfterDelirium = true;
deliriumCameraShakeStrength = 8;
deliriumCameraShakeFrequency = 50;

// list projectives here. Source -- https://community.bistudio.com/wiki/Arma_3_CfgMagazines#RPG32_F
_listOfPorjectiles =
[

	"IEDLandBig_Remote_Ammo",
	"IEDUrbanBig_Remote_Ammo",
	"DemoCharge_Remote_Ammo",
	"SatchelCharge_Remote_Ammo",
	"ClaymoreDirectionalMine_Remote_Ammo",
	"APERSTripMine_Wire_Ammo",
	"APERSBoundingMine_Range_Ammo",
	"APERSMine_Range_Ammo"

];

if !(_typeOfProjectile in _listOfPorjectiles) then
{	

	if (_isDeliriumActive) then {
	    if ((damage _unit) + _amountOfDamage > _neededDamageToActivateDelirium && !(player getVariable ["deliriumActive", false])) then
		{
			player setVariable ["deliriumActive", true];
			player allowDamage false;
			player setDamage _neededDamageToActivateDelirium;
			_amountOfDamage = 0;
			systemChat format ["You are DELIRIUM now for %1 minutes!", deliriumMinutes];
			enableCamShake true;
			_amountOfDamage;
			_this spawn
			{
				_endTime = time + (deliriumMinutes * 60);
				while{minimumDamageToRestoreFromDeliriumStatus <= damage player && time <= _endTime} do
				{
					addCamShake [deliriumCameraShakeStrength, deliriumMinutes * 60, deliriumCameraShakeFrequency];
					uiSleep 1;
				};
				systemChat "You are no longer DELIRIUM";
				player allowDamage true;
				enableCamShake false;
				resetCamShake;
				if (restoreFullHealthAfterDelirium) then {player setDamage 0;};
				player setVariable ["deliriumActive", false];
			};
	    };
	};
}
else
{
	player setDamage 1;
};	

 

This "should" kill the player if the source of damage is an explosion (defined in the list) or, its a headshot. Dunno if itll work, it should, but it might not. Send me errors maybe ill fix em if I can or thank me, if it works.. the code above 100% will work though (excluding the headshot input)

Spoiler

/**
 * Exile Mod
 * www.exilemod.com
 * © 2015 Exile Mod Team
 *
 * This work is licensed under the Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License. 
 * To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/.
 */
 
private["_unit","_selectionName","_amountOfDamage","_sourceOfDamage","_typeOfProjectile"];
_unit             = _this select 0;
_selectionName    = _this select 1;
_amountOfDamage   = _this select 2;
_sourceOfDamage   = _this select 3;
_typeOfProjectile = _this select 4;

_isDeliriumActive = true;
_neededDamageToActivateDelirium = 0.98;
deliriumMinutes  = 1;
minimumDamageToRestoreFromDeliriumStatus = 0.85;
restoreFullHealthAfterDelirium = true;
deliriumCameraShakeStrength = 8;
deliriumCameraShakeFrequency = 50;

// list projectives here. Source -- https://community.bistudio.com/wiki/Arma_3_CfgMagazines#RPG32_F
_listOfPorjectiles =
[

	"IEDLandBig_Remote_Ammo",
	"IEDUrbanBig_Remote_Ammo",
	"DemoCharge_Remote_Ammo",
	"SatchelCharge_Remote_Ammo",
	"ClaymoreDirectionalMine_Remote_Ammo",
	"APERSTripMine_Wire_Ammo",
	"APERSBoundingMine_Range_Ammo",
	"APERSMine_Range_Ammo"

];

_headShot = ["head_hit"];

if (!(_typeOfProjectile in _listOfPorjectiles) || !(_selectionName in _headShot)) then
{	

	if (_isDeliriumActive) then {
	    if ((damage _unit) + _amountOfDamage > _neededDamageToActivateDelirium && !(player getVariable ["deliriumActive", false])) then
		{
			player setVariable ["deliriumActive", true];
			player allowDamage false;
			player setDamage _neededDamageToActivateDelirium;
			_amountOfDamage = 0;
			systemChat format ["You are DELIRIUM now for %1 minutes!", deliriumMinutes];
			enableCamShake true;
			_amountOfDamage;
			_this spawn
			{
				_endTime = time + (deliriumMinutes * 60);
				while{minimumDamageToRestoreFromDeliriumStatus <= damage player && time <= _endTime} do
				{
					addCamShake [deliriumCameraShakeStrength, deliriumMinutes * 60, deliriumCameraShakeFrequency];
					uiSleep 1;
				};
				systemChat "You are no longer DELIRIUM";
				player allowDamage true;
				enableCamShake false;
				resetCamShake;
				if (restoreFullHealthAfterDelirium) then {player setDamage 0;};
				player setVariable ["deliriumActive", false];
			};
	    };
	};
}
else
{
	player setDamage 1;
};	

 

 

Edited by John

Share this post


Link to post
Share on other sites
Advertisement

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

  • Recently Browsing   0 members

    No registered users viewing this page.