diff --git a/functions/CfgFunctions.hpp b/functions/CfgFunctions.hpp index f9035e1..9f3f211 100644 --- a/functions/CfgFunctions.hpp +++ b/functions/CfgFunctions.hpp @@ -69,6 +69,11 @@ class milsim class mapMarkerToString {}; //needs refactor class stringToMapMarker {}; //needs refactor }; + + class util + { + class getPlayerLogString {}; + }; }; class milsim_respawn { diff --git a/functions/client/fn_bindEventHandlers.sqf b/functions/client/fn_bindEventHandlers.sqf index 08a8cdf..569d3a1 100644 --- a/functions/client/fn_bindEventHandlers.sqf +++ b/functions/client/fn_bindEventHandlers.sqf @@ -3,9 +3,12 @@ if ( !hasInterface ) exitWith {}; player addEventHandler["Respawn", { params ["_unit", "_corpse"]; - _killer = _corpse getVariable ["ace_medical_causeOfDeath", "#scripted"]; + private _killer = _corpse getVariable ["ace_medical_causeOfDeath", "#scripted"]; if (_killer == "respawn_button") then { - format["[MILSIM] (client) %1 was unconscious then clicked the respawn button", name _unit] remoteExec["diag_log", 0]; + format[ + "[MILSIM] (client) RESPAWNED WHILE UNCONSCIOUS %1", + [_unit] call milsim_fnc_getPlayerLogString + ] remoteExec["diag_log", 0]; // format["%1 was unconscious then clicked the respawn button", name _unit] remoteExec["systemChat", 0]; }; } diff --git a/functions/settings/fn_addRespawnChatHandler.sqf b/functions/settings/fn_addRespawnChatHandler.sqf index fa87a52..e0bfaa1 100644 --- a/functions/settings/fn_addRespawnChatHandler.sqf +++ b/functions/settings/fn_addRespawnChatHandler.sqf @@ -3,7 +3,11 @@ { _clientID = _thisArgs select 0; player setDamage 1; - format["[MILSIM] (init) %1 claims they were glitched and respawned - %2", name player, netID player] remoteExec["diag_log", 2]; + format[ + "[MILSIM] (init) CHAT COMMAND RESPAWN playerNetID=%1 %2", + player call BIS_fnc_netId, + [player] call milsim_fnc_getPlayerLogString + ] remoteExec["diag_log", 2]; format["%1 claims they were glitched and respawned (%2)", name player, netID player] remoteExec["systemChat", -_clientID]; }, "all", diff --git a/functions/util/fn_getPlayerLogString.sqf b/functions/util/fn_getPlayerLogString.sqf new file mode 100644 index 0000000..d3f5ae0 --- /dev/null +++ b/functions/util/fn_getPlayerLogString.sqf @@ -0,0 +1,17 @@ +/* + Function: milsim_fnc_getPlayerLogString + + Author: IndigoFox + + Description: + Returns a string containing the player's name, UID and group name in 'key="value"' format. + + Parameters: + 0: _playerObj - The player object to get the string for. +*/ + +params [["_playerObj", objNull]]; +if (isNull _playerObj) exitWith { + "playerName=""ERROR"" playerUID=""ERROR"" playerGroup=""ERROR""" +}; +format["playerName=""%1"" playerUID=""%2"" playerGroup=""%3""", name _playerObj, getPlayerUID _playerObj, groupId (group _playerObj)]; \ No newline at end of file