From e84d6ac16aa16a6cf11f5b9870c4e5d6db55264e Mon Sep 17 00:00:00 2001 From: John Jordan Date: Thu, 30 Nov 2023 21:15:45 +0000 Subject: [PATCH] Move FF damage notifications into evaluateEvent --- .../core/functions/Punishment/fn_punishment.sqf | 9 +-------- .../Punishment/fn_punishment_evaluateEvent.sqf | 11 ++++++++--- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/A3A/addons/core/functions/Punishment/fn_punishment.sqf b/A3A/addons/core/functions/Punishment/fn_punishment.sqf index f20419f479..7a5968e333 100644 --- a/A3A/addons/core/functions/Punishment/fn_punishment.sqf +++ b/A3A/addons/core/functions/Punishment/fn_punishment.sqf @@ -85,23 +85,16 @@ _varspace setVariable ["overhead",_overhead]; _varspace setVariable ["name",_name]; _varspace setVariable ["player",_originalBody]; -///////////////Victim Notifier////////////// -private _injuredComrade = ""; +///////////////Log incident///////////////// private _victimStats = "damaged systemPunished [AI]"; if (_victim isKindOf "Man") then { - _injuredComrade = ["Injured comrade: ",name _victim] joinString ""; //TODO: Localize - [localize "STR_A3A_fn_punish_ff_noti", [_name," ",localize "STR_A3A_fn_punish_pun_hurt"] joinString ""] remoteExecCall ["A3A_fnc_customHint", _victim, false]; private _UIDVictim = ["AI", getPlayerUID _victim] select (isPlayer _victim); _victimStats = ["damaged ",name _victim," [",_UIDVictim,"]"] joinString ""; }; - -/////////////Instigator Notifier//////////// private _playerStats = ["Total-time: ",str _timeTotal," (incl. +",str _timeAdded,"), Offence+Overhead: ",str _offenceTotal," [",str (_offenceTotal-_overhead),"+",str _overhead,"] (incl. +",str _offenceAdded,")"] joinString ""; private _instigatorLog = [["WARNING","GUILTY"] select (_offenceTotal >= 1)," | ",_name," [",_UID,"] ",_victimStats,", ",_playerStats] joinString ""; Info(_instigatorLog); -[localize "STR_A3A_fn_punish_punEval_warning", [localize "STR_A3A_fn_punish_pun_fire",_injuredComrade,_customMessage] joinString "
"] remoteExecCall ["A3A_fnc_customHint", _originalBody, false]; - if (_offenceTotal < 1) exitWith {"WARNING";}; ////////Exit Remote Control (if any)//////// diff --git a/A3A/addons/core/functions/Punishment/fn_punishment_evaluateEvent.sqf b/A3A/addons/core/functions/Punishment/fn_punishment_evaluateEvent.sqf index c38100b9c2..edaeb25aab 100644 --- a/A3A/addons/core/functions/Punishment/fn_punishment_evaluateEvent.sqf +++ b/A3A/addons/core/functions/Punishment/fn_punishment_evaluateEvent.sqf @@ -72,15 +72,15 @@ if (_instigator getVariable ["A3A_FFPun_CD", 0] > servertime) exitWith {"PUNISHM _instigator setVariable ["A3A_FFPun_CD", servertime + 1, false]; // Local Exec faster /////////////////Definitions//////////////// +private _injuredComrade = ["", format ["%1 %2",localize "STR_A3A_fn_punish_punEval_injured",name _victim]] select (_victim isKindOf "Man"); private _victimStats = ["damaged ",["systemPunished",name _victim] select (_victim isKindOf "Man")," "] joinString ""; _victimStats = [_victimStats,"[",["AI",getPlayerUID _victim] select (isPlayer _victim),"]"] joinString ""; private _notifyVictim = { - if (isPlayer _victim) then {[localize "STR_A3A_fn_punish_ff_noti", format[localize "STR_A3A_fn_punish_punEval_hurt",name _instigator]] remoteExec ["A3A_fnc_customHint", _victim, false];}; + if (isPlayer _victim) then {[localize "STR_A3A_fn_punish_ff_noti", format [localize "STR_A3A_fn_punish_punEval_hurt", name _instigator]] remoteExec ["A3A_fnc_customHint", _victim, false];}; }; private _notifyInstigator = { params ["_exempMessage"]; - private _comradeStats = ["",[localize "STR_A3A_fn_punish_punEval_injured"," ",name _victim,""] joinString ""] select (_victim isKindOf "Man"); - [localize "STR_A3A_fn_punish_punEval_warning", [_exempMessage,_comradeStats,_customMessage] joinString "
"] remoteExec ["A3A_fnc_customHint", _instigator, false]; + [localize "STR_A3A_fn_punish_punEval_warning", [_exempMessage, _injuredComrade, _customMessage] joinString "
"] remoteExec ["A3A_fnc_customHint", _instigator, false]; }; private _logPvPHurt = { if (!(_victim isKindOf "Man")) exitWith {}; @@ -152,6 +152,11 @@ if (!(_exemption isEqualTo "")) exitWith { _exemption; }; +///////Non-exempt victim & instigator notifiers////// +call _notifyVictim; +[localize "STR_A3A_fn_punish_punEval_warning", [localize "STR_A3A_fn_punish_pun_fire", _injuredComrade, _customMessage] joinString "
"] remoteExecCall ["A3A_fnc_customHint", _instigator, false]; + + if (tkPunish == 2) exitWith {"NOTIFYONLY"}; ///////////////Drop The Hammer//////////////