From 23b6ad245531b1256c94a2067ba698ff105699b7 Mon Sep 17 00:00:00 2001 From: ebaydayz Date: Thu, 21 Apr 2016 13:27:05 -0400 Subject: [PATCH] Add systemChat death message option --- SQF/dayz_code/configVariables.sqf | 3 +-- SQF/dayz_code/system/REsec.sqf | 2 +- SQF/dayz_server/compile/server_playerDied.sqf | 7 +++++-- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/SQF/dayz_code/configVariables.sqf b/SQF/dayz_code/configVariables.sqf index 5a16067f1..a3494adc1 100644 --- a/SQF/dayz_code/configVariables.sqf +++ b/SQF/dayz_code/configVariables.sqf @@ -22,9 +22,8 @@ DynamicVehicleFuelHigh = 100; // Max fuel random vehicles can spawn with DZE_AntiWallLimit = 3; // Number of activations before player_antiWall kills player for glitching attempt. Lower is stricter, but may result in false positives. DZE_DamageBeforeMaint = 0.09; // Minimum damage built items must have before they can be maintained +DZE_DeathMsgChat = "none"; //"none","global","side","system" Display death messages in selected chat channel. DZE_DeathMsgDynamicText = false; // Display death messages as dynamicText in the top left with weapon icons. -DZE_DeathMsgGlobal = false; // Display death messages in global chat -DZE_DeathMsgSide = false; // Display death messages in side chat DZE_DeathMsgTitleText = false; // Display death messages as title text DZE_DeathScreen = true; // True=Use Epoch death screen (Trade city obituaries have been amended) False=Use DayZ death screen (You are dead) DZE_HaloJump = true; // Enable halo jumping out of air vehicles above 400m diff --git a/SQF/dayz_code/system/REsec.sqf b/SQF/dayz_code/system/REsec.sqf index 97a048be8..a7cd6ce05 100644 --- a/SQF/dayz_code/system/REsec.sqf +++ b/SQF/dayz_code/system/REsec.sqf @@ -19,7 +19,7 @@ private["_ofn","_nfn"]; _ofn=format["r%1code",_x]; _nfn=format["r%1code%2",_x,round(random(100000))]; //rSpawn is needed on clients only if one of these death message types is enabled - if (_x == "spawn" && {!isDedicated} && {DZE_DeathMsgDynamicText or DZE_DeathMsgGlobal or DZE_DeathMsgSide}) then { + if (_x == "spawn" && {!isDedicated} && {DZE_DeathMsgDynamicText or (toLower DZE_DeathMsgChat != "none")}) then { // treat as traced on clients call compile format["%1=%2;%2={diag_log(""Allowed RE on clients for death message %2 args:""+str(_this));_this call %1};",_nfn,_ofn]; } else { diff --git a/SQF/dayz_server/compile/server_playerDied.sqf b/SQF/dayz_server/compile/server_playerDied.sqf index 0f08ebbfb..0567649ab 100644 --- a/SQF/dayz_server/compile/server_playerDied.sqf +++ b/SQF/dayz_server/compile/server_playerDied.sqf @@ -62,8 +62,11 @@ if (_killerMethod in ["starve","dehyd","sick","bled","crushed","rad","zombie"]) if ((_killerWeapon != "unknown weapon") or {_killerMethod != "unknown"} or {_killerName != "unknown"}) then { diag_log _message; // Use FunctionsManager logic unit (BIS_functions_mainscope) to send chat messages so no side or quotation marks are shown - if (DZE_DeathMsgGlobal) then {[nil,nil,rspawn,[BIS_functions_mainscope,_message],{(_this select 0) globalChat (_this select 1)}] call RE;}; - if (DZE_DeathMsgSide) then {[nil,nil,rspawn,[BIS_functions_mainscope,_message],{(_this select 0) sideChat (_this select 1)}] call RE;}; + switch (toLower DZE_DeathMsgChat) do { + case "global": {[nil,nil,rspawn,[BIS_functions_mainscope,_message],{(_this select 0) globalChat (_this select 1)}] call RE;;}; + case "side": {[nil,nil,rspawn,[BIS_functions_mainscope,_message],{(_this select 0) sideChat (_this select 1)}] call RE;}; + case "system": {[nil,nil,rspawn,_message,{systemChat _this}] call RE;}; + }; if (DZE_DeathMsgTitleText) then {[nil,nil,"per",rTITLETEXT,("\n\n" + _message),"PLAIN DOWN"] call RE;}; // Store death messages to allow viewing at message board in trader citys.