From 16117b035c6b456ccf71fcc995aeffbb51d8b2b3 Mon Sep 17 00:00:00 2001 From: worldwidesorrow Date: Thu, 12 Dec 2019 05:01:47 -0600 Subject: [PATCH] Add option to give another player an antibacterial wipe. --- SQF/dayz_code/medical/wipes.sqf | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/SQF/dayz_code/medical/wipes.sqf b/SQF/dayz_code/medical/wipes.sqf index cad2bd5cd..fcb5dc9e8 100644 --- a/SQF/dayz_code/medical/wipes.sqf +++ b/SQF/dayz_code/medical/wipes.sqf @@ -1,4 +1,6 @@ -private "_finished"; +private ["_finished","_unit"]; + +_unit = (_this select 3) select 0; if (dayz_actionInProgress) exitWith {localize "str_player_actionslimit" call dayz_rollingMessages;}; dayz_actionInProgress = true; @@ -18,10 +20,23 @@ if (vehicle player == player) then { }; if (_finished) then { - r_player_Sepsis = [false, 0]; - player setVariable ["USEC_Sepsis", false, true]; - player setVariable ["sepsisStarted", nil]; - localize "str_actions_medical_wipe_self" call dayz_rollingMessages; + if (_unit == player) then { + // Self healing + r_player_Sepsis = [false, 0]; + _unit setVariable ["USEC_Sepsis", false, true]; + _unit setVariable ["sepsisStarted", nil]; + + localize "str_actions_medical_wipe_self" call dayz_rollingMessages; + } else { + // Heal another player + PVDZ_send = [_unit,"AntiBacterialWipe",[_unit,player]]; + publicVariableServer "PVDZ_send"; + + // Give humanity + [20,0] call player_humanityChange; + + format[localize "str_actions_medical_general_give",localize "STR_ITEM_DESC_WIPES",(name _unit)] call dayz_rollingMessages; + }; } else { player addMagazine "ItemAntibacterialWipe"; };