/*
File: fn_civMarkers.sqf
Author:
Description:
Add markers for civilians in groups.
*/
private ["_markers", "_members"];
_markers = [];
_members = [];
for "_i" from 0 to 1 step 0 do {
sleep 0.5;
if (visibleMap) then {
_members = units (group player);
{
if (!(_x isEqualTo player) && ("ItemGPS" in (assignedItems _X)) && ("ItemGPS" in (assignedItems player))) then {
_marker = createMarkerLocal [format ["%1_marker", _x], visiblePosition _x];
_marker setMarkerColorLocal "ColorCivilian";
_marker setMarkerTypeLocal "Mil_dot";
_marker setMarkerTextLocal format ["%1", _x getVariable ["realname", name _x]];
_markers pushBack [_marker, _x];
};
} forEach _members;
//Bloc si vous voulez que chaque joueur se voit sur la carte (avec le nom) s'ils ont un GPS
if ("ItemGPS" in (assignedItems player)) then {
_me = createMarkerLocal [format ["%1_marker",player],visiblePosition player];
_me setMarkerColorLocal "ColorRed";
_me setMarkerTypeLocal "Mil_dot";
_markers pushBack [_me,player];
};
while {visibleMap} do {
{
private ["_unit"];
_unit = _x select 1;
if (!isNil "_unit" && !isNull _unit) then {
(_x select 0) setMarkerPosLocal (visiblePosition _unit);
};
} forEach _markers;
if (!visibleMap) exitWith { };
sleep 0.02;
};
{ deleteMarkerLocal (_x select 0); } forEach _markers;
_markers = [];
_members = [];
};
};