added synced units as global variables

This commit is contained in:
Valmo Trindade
2025-05-20 01:49:17 -03:00
parent 730440f4ac
commit 67fa1cfe52
2 changed files with 12 additions and 15 deletions

View File

@@ -24,22 +24,20 @@ if (isServer) exitWith {
missionNamespace setVariable ["armatak_marked_units", _syncUnits];
_syncedUnits = missionNamespace getVariable "armatak_marked_units";
GVAR(syncedUnits) = missionNamespace getVariable "armatak_marked_units";
[{
_syncedUnits = missionNamespace getVariable "armatak_marked_units";
GVAR(syncedUnits) = missionNamespace getVariable "armatak_marked_units";
{
_objectType = _x call BIS_fnc_objectType;
if ((_objectType select 0) == "Soldier") then {
if (!GETVAR(_x,EGVAR(client,eudConnected),false)) then {
_callsign = [_x] call armatak_fnc_extract_unit_callsign;
_group_name = [group _x] call armatak_fnc_extract_group_color;
_group_role = [_x] call armatak_fnc_extract_group_role;
_callsign = [_x] call armatak_fnc_extract_unit_callsign;
_group_name = [group _x] call armatak_fnc_extract_group_color;
_group_role = [_x] call armatak_fnc_extract_group_role;
[_x, _callsign, _group_name, _group_role] call armatak_fnc_send_eud_cot;
[_x] call armatak_fnc_send_digital_pointer_cot;
};
[_x, _callsign, _group_name, _group_role] call armatak_fnc_send_eud_cot;
[_x] call armatak_fnc_send_digital_pointer_cot;
};
if ((_objectType select 0) == "Vehicle") then {
_atak_type = [_x] call armatak_fnc_extract_role;
@@ -51,7 +49,7 @@ if (isServer) exitWith {
[_x] call armatak_fnc_send_drone_cot;
[_x] call armatak_fnc_send_digital_pointer_cot;
};
} forEach _syncedUnits;
} forEach GVAR(syncedUnits);
}, 2, []] call CBA_fnc_addPerFrameHandler;
};

View File

@@ -26,10 +26,10 @@ _syncUnits = [];
missionNamespace setVariable ["armatak_marked_units", _syncUnits];
_syncedUnits = missionNamespace getVariable "armatak_marked_units";
/*
GVAR(syncedUnits) = missionNamespace getVariable "armatak_marked_units";
[{
_syncedUnits = missionNamespace getVariable "armatak_marked_units";
GVAR(syncedUnits) = missionNamespace getVariable "armatak_marked_units";
{
_objectType = _x call BIS_fnc_objectType;
@@ -51,8 +51,7 @@ _syncedUnits = missionNamespace getVariable "armatak_marked_units";
[_x] call armatak_fnc_send_drone_cot;
[_x] call armatak_fnc_send_digital_pointer_cot;
};
} forEach _syncedUnits;
} forEach GVAR(syncedUnits);
}, 2, []] call CBA_fnc_addPerFrameHandler;
*/
closeDialog 1;