mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2025-12-14 04:02:37 +03:00
General code audit.
This commit is contained in:
@@ -1,6 +1,4 @@
|
|||||||
#include "\z\addons\dayz_code\util\array.hpp";
|
private ["_msg","_unit","_medsUsed"];
|
||||||
|
|
||||||
private ["_msg","_antibiotics","_hasAntibiotics","_id","_hasMeds","_unit","_medsUsed"];
|
|
||||||
|
|
||||||
if (count _this > 2) then {
|
if (count _this > 2) then {
|
||||||
_unit = (_this select 3) select 0;
|
_unit = (_this select 3) select 0;
|
||||||
@@ -10,31 +8,21 @@ if (count _this > 2) then {
|
|||||||
_medsUsed = _this select 1;
|
_medsUsed = _this select 1;
|
||||||
};
|
};
|
||||||
|
|
||||||
_antibiotics =["ItemAntibiotic","ItemAntibiotic1","ItemAntibiotic2","ItemAntibiotic3","ItemAntibiotic4","ItemAntibiotic5","ItemAntibiotic6"];
|
if (isNil "_medsUsed") then {
|
||||||
_hasAntibiotics = false;
|
{
|
||||||
|
if (_x in magazines player) exitWith {
|
||||||
{
|
// Set antibiotics if not defined (used when giving to somebody)
|
||||||
if (_x in magazines player) exitWith {
|
|
||||||
// Set antibiotics if not defined (used when giving to somebody)
|
|
||||||
if(isNil "_medsUsed") then {
|
|
||||||
_medsUsed = _x;
|
_medsUsed = _x;
|
||||||
};
|
};
|
||||||
_hasAntibiotics = true;
|
} count ["ItemAntibiotic","ItemAntibiotic1","ItemAntibiotic2","ItemAntibiotic3","ItemAntibiotic4","ItemAntibiotic5","ItemAntibiotic6"];
|
||||||
};
|
};
|
||||||
} count _antibiotics;
|
|
||||||
|
|
||||||
_msg = "str_actions_medical_misplaced_antibiotics";
|
_msg = localize "str_actions_medical_misplaced_antibiotics";
|
||||||
|
|
||||||
if (_hasAntibiotics) then {
|
if !(isNil "_medsUsed") then {
|
||||||
//Remove one table from the box.
|
//Remove one table from the box.
|
||||||
[_medsUsed,"medical"] call dayz_reduceItems;
|
[_medsUsed,"medical"] call dayz_reduceItems;
|
||||||
|
|
||||||
|
|
||||||
//remove infection
|
|
||||||
//Called in medAntis
|
|
||||||
//r_player_infected = false;
|
|
||||||
//_unit setVariable["USEC_infected",false,true];
|
|
||||||
|
|
||||||
//remove option
|
//remove option
|
||||||
call fnc_usec_medic_removeActions;
|
call fnc_usec_medic_removeActions;
|
||||||
r_action = false;
|
r_action = false;
|
||||||
@@ -42,22 +30,23 @@ if (_hasAntibiotics) then {
|
|||||||
//player removeAction s_player_antiobiotic;
|
//player removeAction s_player_antiobiotic;
|
||||||
//s_player_antiobiotic = -1;
|
//s_player_antiobiotic = -1;
|
||||||
|
|
||||||
if ((_unit == player) or (vehicle player != player)) then {
|
if (_unit == player) then {
|
||||||
//Self Healing
|
//Self Healing
|
||||||
_id = [player,player] execVM "\z\addons\dayz_code\medical\publicEH\medAntibiotics.sqf";
|
r_player_infected = false;
|
||||||
|
_unit setVariable["USEC_infected",false,true];
|
||||||
|
|
||||||
_msg = "str_actions_medical_taken_antibiotics";
|
_msg = localize "str_actions_medical_taken_antibiotics";
|
||||||
} else {
|
} else {
|
||||||
//Send request to other player
|
// Heal another player
|
||||||
PVDZ_send = [_unit,"Antibiotics",[_unit,player]];
|
PVDZ_send = [_unit,"Antibiotics",[_unit,player]];
|
||||||
publicVariableServer "PVDZ_send";
|
publicVariableServer "PVDZ_send";
|
||||||
|
|
||||||
//Give humnaity for good deeds
|
//Give humnaity for good deeds
|
||||||
[20,0] call player_humanityChange;
|
[20,0] call player_humanityChange;
|
||||||
|
|
||||||
_msg = "str_actions_medical_gave_antibiotics";
|
_msg = format[localize "str_actions_medical_gave_antibiotics", (name _unit)];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
localize _msg call dayz_rollingMessages;
|
_msg call dayz_rollingMessages;
|
||||||
|
|||||||
Reference in New Issue
Block a user