From eedc3b68bbb2e7748f227ff2796f892384e6dceb Mon Sep 17 00:00:00 2001 From: He-Man Date: Mon, 19 Aug 2019 19:25:04 +0200 Subject: [PATCH] Show Players Playtime in AdminMenu --- .../compile/epoch_player/EPOCH_server_loadPlayer.sqf | 5 +++++ .../compile/epoch_player/EPOCH_server_revivePlayer.sqf | 1 + Sources/epoch_server/init/server_securityfunctions.sqf | 2 +- changelog.md | 2 ++ 4 files changed, 9 insertions(+), 1 deletion(-) diff --git a/Sources/epoch_server/compile/epoch_player/EPOCH_server_loadPlayer.sqf b/Sources/epoch_server/compile/epoch_player/EPOCH_server_loadPlayer.sqf index 3f6e9bc9..63971599 100644 --- a/Sources/epoch_server/compile/epoch_player/EPOCH_server_loadPlayer.sqf +++ b/Sources/epoch_server/compile/epoch_player/EPOCH_server_loadPlayer.sqf @@ -273,6 +273,11 @@ if (!isNull _player) then { _currentStat = _communityStats select _Index; _communityStats set[_Index, _currentStat + 1]; }; + _Index = EPOCH_communityStats find "PlayTime"; + if (_Index > -1) then { + _currentStat = _communityStats select _Index; + _newPlyr setVariable["EPOCH_playerPlayTime", _currentStat, true]; + }; _newPlyr setVariable["COMMUNITY_STATS", _communityStats]; diff --git a/Sources/epoch_server/compile/epoch_player/EPOCH_server_revivePlayer.sqf b/Sources/epoch_server/compile/epoch_player/EPOCH_server_revivePlayer.sqf index 35b0367b..6bdc712b 100644 --- a/Sources/epoch_server/compile/epoch_player/EPOCH_server_revivePlayer.sqf +++ b/Sources/epoch_server/compile/epoch_player/EPOCH_server_revivePlayer.sqf @@ -118,6 +118,7 @@ if (!local _player) then { _newPlyr setVariable ["GROUP", _playerGroup]; _newPlyr setVariable ["REVIVE", false]; _newPlyr setVariable ["SERVER_VARS",_player getVariable ["SERVER_VARS",[]]]; + _newPlyr setVariable ["EPOCH_playerPlayTime",_player getvariable ["EPOCH_playerPlayTime",0],true]; // _player playActionNow "Die"; diff --git a/Sources/epoch_server/init/server_securityfunctions.sqf b/Sources/epoch_server/init/server_securityfunctions.sqf index 035358e6..002b1d8b 100644 --- a/Sources/epoch_server/init/server_securityfunctions.sqf +++ b/Sources/epoch_server/init/server_securityfunctions.sqf @@ -2071,7 +2071,7 @@ _skn_admincode = compileFinal (" if (_sorted isEqualTo []) then {_sorted = [player]}; _skn_fnc_addPlayerToList = { _player = _this select 0; - _index = _ctrl lbAdd format ['%1', name _player]; + _index = _ctrl lbAdd format ['%1', format ['%1 [%2 h]',name _player,((_player getvariable ['EPOCH_playerPlayTime',0])/60/60) toFixed 1]]; _ctrl lbSetData [_index, netId _player]; _ctrl lbSetColor [_index, _this select 1]; if (vehicle _player == _player) then { diff --git a/changelog.md b/changelog.md index a0c1ac62..b664fac9 100644 --- a/changelog.md +++ b/changelog.md @@ -53,6 +53,8 @@ All changes for [Arma 3](https://arma3.com/) [Epoch Mod](https://epochmod.com) a - respawn_east - respawn_west - all VirtualMan_EPOCH Entities +- Players playtimes are now shown in the Playerlist in Adminmenu + - https://cdn.discordapp.com/attachments/474595539107971072/613059969943601208/unknown.png ## [1.3.1.0] - 2019-03-28 ### Added