Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move FF damage notifications into evaluateEvent (master) #3078

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 1 addition & 8 deletions A3A/addons/core/functions/Punishment/fn_punishment.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -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 "<br/>"] remoteExecCall ["A3A_fnc_customHint", _originalBody, false];

if (_offenceTotal < 1) exitWith {"WARNING";};

////////Exit Remote Control (if any)////////
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 "<br/>"] remoteExec ["A3A_fnc_customHint", _instigator, false];
[localize "STR_A3A_fn_punish_punEval_warning", [_exempMessage, _injuredComrade, _customMessage] joinString "<br/>"] remoteExec ["A3A_fnc_customHint", _instigator, false];
};
private _logPvPHurt = {
if (!(_victim isKindOf "Man")) exitWith {};
Expand Down Expand Up @@ -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 "<br/>"] remoteExecCall ["A3A_fnc_customHint", _instigator, false];


if (tkPunish == 2) exitWith {"NOTIFYONLY"};

///////////////Drop The Hammer//////////////
Expand Down