ZGreen-Spectre
Well-Known Member
Spectre's Knockout/Revive Player Death
Version 1.5
When the player reaches 100 life they are knocked out, either until revived with an epi-pen or they choose suicide through a scroll wheel option. The attacking player can approach their victim and execute them silently with a knife, they lose humanity based on the humanity of their target (optional and adjustable).
Files Modified:
Init.sqf
Compiles.sqf
Variables.sqf
setup_functions_med.sqf
fn_selfActions.sqf
fn_damageHandler.sqf
fn_unconscious.sqf
Files Added:
player_suicide.sqf
player_execute.sqf
Difficulty
Moderate = Orange 10-30
Installation Steps -
All necessary files are included in the download, if you have any of the files in the Revive folder on github then simply merge them using a program like notepad ++
Instructions on how to merge some common files are provided below.
Step 1: For init.sqf
Code:
// Compile and call important functions
call compile preprocessFileLineNumbers "\z\addons\dayz_code\init\variables.sqf";
progressLoadingScreen 0.1;
call compile preprocessFileLineNumbers "\z\addons\dayz_code\init\publicEH.sqf";
progressLoadingScreen 0.2;
call compile preprocessFileLineNumbers "\z\addons\dayz_code\medical\setup_functions_med.sqf";
progressLoadingScreen 0.4;
call compile preprocessFileLineNumbers "\z\addons\dayz_code\init\compiles.sqf";
progressLoadingScreen 1.0;
Code:
// Compile and call important functions
call compile preprocessFileLineNumbers "Revive\variables.sqf";
progressLoadingScreen 0.1;
call compile preprocessFileLineNumbers "\z\addons\dayz_code\init\publicEH.sqf";
progressLoadingScreen 0.2;
call compile preprocessFileLineNumbers "Revive\setup_functions_med.sqf";
progressLoadingScreen 0.4;
call compile preprocessFileLineNumbers "Revive\compiles.sqf";
progressLoadingScreen 1.0;
If your init.sqf looks like the first code then change it to the second code, download the provided folder and place it into your mission.pbo and skip to step 4.
Step:2 For variables.sqf look for
dayz_resetSelfActions = {
at the bottom of the s_player list add
s_player_suicide = -1;
it should now look something like this
Code:
dayz_resetSelfActions = {
s_player_fillfuel20 = -1;
s_player_fillfuel5 = -1;
s_player_suicide = -1;
};
call dayz_resetSelfActions;
Step 3: for compiles.sqf look for
Code:
fnc_usec_selfActions = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_selfActions.sqf"; //Checks which actions for self
fnc_usec_unconscious = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_unconscious.sqf";
fnc_usec_damageHandler = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_damageHandler.sqf"; //Event handler run on damage
player_medEpi = compile preprocessFileLineNumbers "\z\addons\dayz_code\medical\publicEH\medEpi.sqf";
Code:
fnc_usec_selfActions = compile preprocessFileLineNumbers "Revive\fn_selfActions.sqf"; //Checks which actions for self
fnc_usec_unconscious = compile preprocessFileLineNumbers "Revive\fn_unconscious.sqf";
fnc_usec_damageHandler = compile preprocessFileLineNumbers "Revive\fn_damageHandler.sqf"; //Event handler run on damage
player_medEpi = compile preprocessFileLineNumbers "Revive\medEpi.sqf";
Step 4: for fn_selfActions.sqf insert
Code:
// ------------------------------------------------------------------------Spectres Suicide Start------------------------------------------------------------------------
if ((r_player_blood <= 1000) and (r_player_unconscious)) then {
nearDead = true;
} else { nearDead = false;};
if( nearDead ) then{
if (s_player_suicide < 0) then {
s_player_suicide = player addaction[("<t color=""#c70000"">" + ("Suicide") +"</t>"),"Revive\player_suicide.sqf","",5,false,true,"", ""];
};
} else {
player removeAction s_player_suicide;
s_player_suicide = -1;
};
// -------------------------------------------------------------------------Spectres Suicide End--------------------------------------------------------------------------
below _canDo = (!r_drag_sqf and !r_player_unconscious and !_onLadder);
Step 5: for fn_selfActions.sqf insert
Code:
//------------------------------------------------------------------------Spectre's Execute Start--------------------------------------------------------
_unconscious = cursorTarget getVariable ["NORRN_unconscious", false];
if (_isMan and _isAlive and !_isZombie and !_isAnimal and _unconscious and _hasKnife and _canDo and (player distance cursorTarget < 3)) then {
if (s_player_execute < 0) then {
s_player_execute = cursorTarget addAction [format[("<t color=""#ee8900"">" + ("Execute") +"</t>")],"Revive\player_execute.sqf",cursorTarget,0,true,true,"",""];
};
} else {
player removeAction s_player_execute;
s_player_execute = -1;
};
//------------------------------------------------------------------------Spectre's Execute End--------------------------------------------------------------
s_player_studybody = -1;
};
-Credits-
Krixes' Self Bloodbag
For providing a self actions template to work from for player_suicide.
For the idea!
OP
Download
Here
Discussion/Support starts
HERE