Files
MissionTemplate/functions/respawn/fn_showReinsertQueueNotification.sqf

56 lines
1.1 KiB
Plaintext

private _par = [["Players Awaiting Reinsert", 1.2, [1,0.64,0,1]]];
private _baseNames = (missionNamespace getVariable ["milsim_respawn_reinsertionQueue", []]) apply {_x#1};
{
private _baseName = _x;
private _peopleAtThisBase = (missionNamespace getVariable ["milsim_respawn_reinsertionQueue", []]) select {
_x#1 isEqualTo _baseName
} apply {
private _timeInQueue = diag_tickTime - (_x#2);
[
format [
"%1: %2 [%3]",
groupId (group (_x#0)),
name (_x#0),
[_timeInQueue, "MM:SS"] call BIS_fnc_secondsToString
],
0.7,
[1,1,1,1]
];
};
_peopleAtThisBase = [
_peopleAtThisBase,
[],
{_x#0}
] call BIS_fnc_sortBy;
private _playerCountText = "";
switch (count _peopleAtThisBase) do {
case 0: {
_playerCountText = "No players";
};
case 1: {
_playerCountText = "1 player";
};
default {
_playerCountText = format ["%1 players", count _peopleAtThisBase];
};
};
_par pushBack [
format ["Location: %1 (%2)",
_baseName,
_playerCountText
],
1,
[0,1,0,1]
];
{
_par pushBack _x;
} forEach _peopleAtThisBase;
} forEach _baseNames;
_par call CBA_fnc_notify;
true;