ADded handling for multiplayer or singleplayer sessions on init function

This commit is contained in:
Valmo Trindade
2024-08-04 18:12:49 -03:00
parent 29a75daa68
commit 2e537455b7
3 changed files with 19 additions and 7 deletions

View File

@@ -18,17 +18,29 @@ if (_activated) exitWith {
missionNamespace setVariable ["_atak_server_instance", _atak_fts_fulladdress];
missionNamespace setVariable ["_atak_server_instance_token", _atak_fts_bearer_token];
{
[{
_uid = _x getVariable "_atak_uid";
if (isMultiplayer) then {
{
[{
_uid = _x getVariable "_atak_uid";
if (isNull _uid) then {
_x call armatak_fnc_postGeoObject;
if (_uid == "") then {
_x call armatak_fnc_postGeoObject;
} else {
_x call armatak_fnc_putGeoObject;
};
}, 2, []] call CBA_fnc_addPerFrameHandler;
} forEach playableUnits;
} else {
[{
_uid = player getVariable "_atak_uid";
if (_uid == "") then {
player call armatak_fnc_postGeoObject;
} else {
_x call armatak_fnc_putGeoObject;
player call armatak_fnc_putGeoObject;
};
}, 2, []] call CBA_fnc_addPerFrameHandler;
} forEach playableUnits;
}
private _warning = format ["<t color='#FF8021'>ARMATAK</t><br/> %1", "Connected!"];
[[_warning, 1.5]] call CBA_fnc_notify;