From 86634100477123b5fce9b7ebc55d4b39c80ae9c9 Mon Sep 17 00:00:00 2001 From: Andreas Brostrom Date: Wed, 21 Jul 2021 22:18:03 +0200 Subject: [PATCH] Added moduel and event to log and save attending and attended players --- cScripts/CavFnc/cScripts_postInit.sqf | 4 ++++ cScripts/CavFnc/functions/init/fn_initEvents.sqf | 9 ++++++++- cScripts/CavFnc/functions/init/fn_initModulesZen.sqf | 9 +++++++++ .../CavFnc/functions/modules/fn_zenModuleCallEndex.sqf | 4 +++- 4 files changed, 24 insertions(+), 2 deletions(-) diff --git a/cScripts/CavFnc/cScripts_postInit.sqf b/cScripts/CavFnc/cScripts_postInit.sqf index 047c057a8..3f63589c3 100644 --- a/cScripts/CavFnc/cScripts_postInit.sqf +++ b/cScripts/CavFnc/cScripts_postInit.sqf @@ -29,6 +29,10 @@ if (EGVAR(Settings,showDiaryRecords)) then { call FUNC(initDocuments); }; +onPlayerConnected { + [QEGVAR(log,player), [name player]] call CBA_fnc_serverEvent; +}; + #ifdef DEBUG_MODE ["Initialization completed", "postInit"] call FUNC(info); #endif diff --git a/cScripts/CavFnc/functions/init/fn_initEvents.sqf b/cScripts/CavFnc/functions/init/fn_initEvents.sqf index 7b628b331..8f818122a 100644 --- a/cScripts/CavFnc/functions/init/fn_initEvents.sqf +++ b/cScripts/CavFnc/functions/init/fn_initEvents.sqf @@ -21,4 +21,11 @@ if !(isServer) exitWith {}; [QEGVAR(event,logServer), { diag_log text _this; -}] call CBA_fnc_addEventHandler; \ No newline at end of file +}] call CBA_fnc_addEventHandler; + +[QEGVAR(log,player), { + _this params ["_playerName"]; + private _playerLog = missionNamespace getVariable [QEGVAR(log,players), []]; + _playerLog pushBack _playerName; + missionNamespace setVariable [QEGVAR(log,players), _playerLog]; +}] call CBA_fnc_addEventHandler; diff --git a/cScripts/CavFnc/functions/init/fn_initModulesZen.sqf b/cScripts/CavFnc/functions/init/fn_initModulesZen.sqf index ddc751b24..fd42417e7 100644 --- a/cScripts/CavFnc/functions/init/fn_initModulesZen.sqf +++ b/cScripts/CavFnc/functions/init/fn_initModulesZen.sqf @@ -84,6 +84,15 @@ if (EGVAR(Settings,enableACRE)) then { "\a3\modules_f\data\portraitmodule_ca.paa" ] call zen_custom_modules_fnc_register; +["7Cav Mission", "Copy attendees to clipboard", + { + private _playerLog = missionNamespace getVariable [QEGVAR(log,players), []]; + copyToClipboard str _playerLog; + ["All attended players have been saved to your clipboard"] call zen_common_fnc_showMessage; + }, + "\a3\modules_f\data\portraitmodule_ca.paa" +] call zen_custom_modules_fnc_register; + #ifdef DEBUG_MODE ["7Cav Custom Zen Modules initialization complete", "initModulesZen"] call FUNC(info); #endif \ No newline at end of file diff --git a/cScripts/CavFnc/functions/modules/fn_zenModuleCallEndex.sqf b/cScripts/CavFnc/functions/modules/fn_zenModuleCallEndex.sqf index 04a047e13..9dbae38b5 100644 --- a/cScripts/CavFnc/functions/modules/fn_zenModuleCallEndex.sqf +++ b/cScripts/CavFnc/functions/modules/fn_zenModuleCallEndex.sqf @@ -112,7 +112,9 @@ params ["_modulePos", "_objectPos"]; [format["Mission var %1 is set %2", QEGVAR(Mission,Endex), missionNamespace getVariable QEGVAR(Mission,Endex)]] call FUNC(info); #endif }; - ["Endex called"] call zen_common_fnc_showMessage; + private _playerLog = missionNamespace getVariable [QEGVAR(log,players), []]; + copyToClipboard str _playerLog; + ["Endex called (All attended players have been saved to your clipboard)"] call zen_common_fnc_showMessage; }, {}, [_modulePos]