big refactor to isolate functionality. adds milsim_fnc_log.

This commit is contained in:
2024-01-30 15:05:02 -08:00
parent f52011cbc4
commit 9ec51a5e19
20 changed files with 714 additions and 375 deletions

View File

@@ -8,10 +8,35 @@
Parameters:
0: _playerObj <OBJECT> - The player object to get the string for.
1: _returnArray <BOOL> - If true, returns a key/value array of the player's name, UID and group name.
*/
params [["_playerObj", objNull]];
if (isNull _playerObj) exitWith {
"playerName=""ERROR"" playerUID=""ERROR"" playerGroup=""ERROR"""
params [["_playerObj", objNull], ["_returnArray", false, [false, true]]];
switch (_returnArray) do {
case false: {
if (isNull _playerObj) exitWith {
"playerName=""ERROR"" playerUID=""ERROR"" playerGroup=""ERROR"""
};
if (true) exitWith {
format["playerName=""%1"" playerUID=""%2"" playerGroup=""%3""", name _playerObj, getPlayerUID _playerObj, groupId (group _playerObj)];
};
};
case true: {
if (isNull _playerObj) exitWith {
[
["playerName", "ERROR"],
["playerUID", "ERROR"],
["playerGroup", "ERROR"]
]
};
if (true) exitWith {
[
["playerName", name _playerObj],
["playerUID", getPlayerUID _playerObj],
["playerGroup", groupId (group _playerObj)]
]
};
};
};
format["playerName=""%1"" playerUID=""%2"" playerGroup=""%3""", name _playerObj, getPlayerUID _playerObj, groupId (group _playerObj)];