-
-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathfn_getPlaytime.sqf
More file actions
30 lines (22 loc) · 834 Bytes
/
fn_getPlaytime.sqf
File metadata and controls
30 lines (22 loc) · 834 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
/*
KPR_fnc_getPlaytime
File: fn_getPlaytime.sqf
Author: Wyqer - https://github.com/KillahPotatoes
Date: 2018-08-21
Last Update: 2018-08-21
License: GNU General Public License v3.0 - https://www.gnu.org/licenses/gpl-3.0.html
Description:
Gets the playtime of the given player as string formatted to days, hours and minutes.
Parameter(s):
0: STRING - Steam UID of the player (default: uid of current player)
Returns:
STRING
*/
params [["_uid", getPlayerUID player]];
private _playtime = [_uid] call KPR_fnc_getPlaytimePlain;
// Generate readable time values
private _playtimeD = floor (_playtime / 1440);
_playtime = _playtime % 1440;
private _playtimeH = floor (_playtime / 60);
private _playtimeM = _playtime % 60;
format ["%1d %2h %3m", _playtimeD, _playtimeH, _playtimeM]