diff --git a/Altis_Life.Altis/core/civilian/fn_civMarkers.sqf b/Altis_Life.Altis/core/civilian/fn_civMarkers.sqf index 13d4960da..1f0267322 100644 --- a/Altis_Life.Altis/core/civilian/fn_civMarkers.sqf +++ b/Altis_Life.Altis/core/civilian/fn_civMarkers.sqf @@ -5,45 +5,30 @@ Description: Add markers for civilians in groups. */ - private _markers = []; -private _members = []; -for "_i" from 0 to 1 step 0 do { - sleep 0.5; - if (visibleMap) then - { - _members = units (group player); - { - if !(_x isEqualTo player) then { - private _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]; - }; - true - } count _members; +{ + private _marker = createMarkerLocal [format ["%1_marker",netID _x],getPosATL _x]; + _marker setMarkerColorLocal "ColorCivilian"; + _marker setMarkerTypeLocal "Mil_dot"; + _marker setMarkerTextLocal format ["%1", _x getVariable ["realname",name _x]]; + _markers pushBack [_marker,_x]; +} forEach ((units (group player)) - [player]); - while {visibleMap} do - { - { - _x params ["_marker", "_unit"]; - if (!isNil "_unit" && {!isNull _unit}) then { - _marker setMarkerPosLocal (visiblePosition _unit); - }; - true - } count _markers; - if (!visibleMap) exitWith {}; - sleep 0.02; +while {visibleMap} do { + { + _x params [ + ["_mark",""], + ["_unit",objNull] + ]; + if !(isNull _unit) then { + _mark setMarkerPosLocal (getPosATL _unit); }; - - { - deleteMarkerLocal (_x select 0); - true - } count _markers; - - _markers = []; - _members = []; - }; + } forEach _markers; + uiSleep 0.01; }; + +{ + _x params [["_mark",""]]; + deleteMarkerLocal _mark; +} forEach _markers; diff --git a/Altis_Life.Altis/core/cop/fn_copMarkers.sqf b/Altis_Life.Altis/core/cop/fn_copMarkers.sqf index d75d63a67..c30edb2c4 100644 --- a/Altis_Life.Altis/core/cop/fn_copMarkers.sqf +++ b/Altis_Life.Altis/core/cop/fn_copMarkers.sqf @@ -3,44 +3,32 @@ Author: Bryan "Tonic" Boardwine Description: - Marks cops on the map for other cops. Only initializes when the actual map is open. + Marks cops on the map for other cops. */ - private _markers = []; -private _cops = []; -sleep 0.5; -if (visibleMap) then { - _cops = playableUnits select {side _x isEqualTo west}; +{ + private _marker = createMarkerLocal [format ["%1_marker",netID _x],getPosATL _x]; + _marker setMarkerColorLocal "ColorBLUFOR"; + _marker setMarkerTypeLocal "Mil_dot"; + _marker setMarkerTextLocal format ["%1", _x getVariable ["realname",name _x]]; + _markers pushBack [_marker,_x]; +} forEach ((units west) - [player]); - //Create markers +while {visibleMap} do { { - if !(_x isEqualTo player) then { - private _marker = createMarkerLocal [format ["%1_marker",_x],visiblePosition _x]; - _marker setMarkerColorLocal "ColorBLUFOR"; - _marker setMarkerTypeLocal "Mil_dot"; - _marker setMarkerTextLocal format ["%1", _x getVariable ["realname",name _x]]; - - _markers pushBack [_marker,_x]; + _x params [ + ["_mark",""], + ["_unit",objNull] + ]; + if !(isNull _unit) then { + _mark setMarkerPosLocal (getPosATL _unit); }; - true - } count _cops; - - while {visibleMap} do { - { - _x params ["_marker","_unit"]; - if (!isNil "_unit" && {!isNull _unit}) then { - _marker setMarkerPosLocal (visiblePosition _unit); - }; - true - } count _markers; - if (!visibleMap) exitWith {}; - sleep 0.02; - }; - - { - deleteMarkerLocal (_x select 0); - } count _markers; - _markers = []; - _cops = []; + } forEach _markers; + uiSleep 0.01; }; + +{ + _x params [["_mark",""]]; + deleteMarkerLocal _mark; +} forEach _markers; diff --git a/Altis_Life.Altis/core/functions/fn_checkMap.sqf b/Altis_Life.Altis/core/functions/fn_checkMap.sqf index 03de18e19..01c279823 100644 --- a/Altis_Life.Altis/core/functions/fn_checkMap.sqf +++ b/Altis_Life.Altis/core/functions/fn_checkMap.sqf @@ -1,25 +1,25 @@ -/* - File: fn_checkMap.sqf - Author: DomT602 - Description: - Checks if the map is being opened or closed, then puts markers according to side. - */ - - params [ - ["_mapOpen",false,[false]] - ]; - - if (_mapOpen) then { - switch playerSide do { - case west: {[] spawn life_fnc_copMarkers}; - case independent: {[] spawn life_fnc_medicMarkers}; - case civilian: {[] spawn life_fnc_civMarkers}; - }; - - if (life_markers && {!(life_markers_active)}) then { - [true] spawn life_fnc_adminMarkers; - }; - - } else { - life_markers_active = false; - }; +/* + File: fn_checkMap.sqf + Author: DomT602 + Description: + Checks if the map is being opened or closed, then puts markers according to side. + */ + + params [ + ["_mapOpen",false,[false]] + ]; + + if (_mapOpen) then { + switch playerSide do { + case west: {[] spawn life_fnc_copMarkers}; + case independent: {[] spawn life_fnc_medicMarkers}; + case civilian: {[] spawn life_fnc_civMarkers}; + }; + + if (life_markers && {!life_markers_active}) then { + [true] spawn life_fnc_adminMarkers; + }; + + } else { + life_markers_active = false; + }; diff --git a/Altis_Life.Altis/core/medical/fn_medicMarkers.sqf b/Altis_Life.Altis/core/medical/fn_medicMarkers.sqf index 2e02f6bdb..2bc796fb8 100644 --- a/Altis_Life.Altis/core/medical/fn_medicMarkers.sqf +++ b/Altis_Life.Altis/core/medical/fn_medicMarkers.sqf @@ -1,61 +1,51 @@ -/* - File: fn_medicMarkers.sqf - Author: Bryan "Tonic" Boardwine - - Description: - Marks downed players on the map when it's open. -*/ -private ["_markers","_units","_medics"]; -_markers = []; -_markersMedecin = []; -_units = []; -_medics = []; - -sleep 0.25; -if (visibleMap) then { - {if (side _x isEqualTo independent) then {_medics pushBack _x;}} forEach playableUnits; //Fetch list of cops / blufor - { - _name = _x getVariable "name"; - _down = _x getVariable ["Revive",false]; - if (!isNil "_name" && !_down) then { - _units pushBack _x; - }; - } forEach allDeadMen; - - { - if !(_x isEqualTo player) then { - _markerss = createMarkerLocal [format ["%1_marker",_x],visiblePosition _x]; - _markerss setMarkerColorLocal "ColorIndependent"; - _markerss setMarkerTypeLocal "Mil_dot"; - _markerss setMarkerTextLocal format ["%1", _x getVariable ["realname",name _x]]; - - _markersMedecin pushBack [_markerss,_x]; - }; - } forEach _medics; - - //Loop through and create markers. - { - _marker = createMarkerLocal [format ["%1_dead_marker",_x],visiblePosition _x]; - _marker setMarkerColorLocal "ColorRed"; - _marker setMarkerTypeLocal "loc_Hospital"; - _marker setMarkerTextLocal format ["%1",(_x getVariable ["name","Unknown Player"])]; - _markers pushBack _marker; - } forEach _units; - - while {visibleMap} do { - { - private ["_unit"]; - _unit = _x select 1; - if (!isNil "_unit" && !isNull _unit) then { - (_x select 0) setMarkerPosLocal (visiblePosition _unit); - }; - } forEach _markersMedecin; - if (!visibleMap) exitWith {}; - sleep 0.02; - }; - {deleteMarkerLocal (_x select 0);} forEach _markersMedecin; - _markersMedecin = []; - _medics = []; - waitUntil {!visibleMap}; - {deleteMarkerLocal _x;} forEach _markers; -}; +/* + File: fn_medicMarkers.sqf + Author: Bryan "Tonic" Boardwine + + Description: + Marks downed players on the map when it's open. +*/ +private _deadMarkers = []; +private _medicMarkers = []; + +{ + private _marker = createMarkerLocal [format ["%1_marker",netID _x],getPosATL _x]; + _marker setMarkerColorLocal "ColorIndependent"; + _marker setMarkerTypeLocal "Mil_dot"; + _marker setMarkerTextLocal format ["%1", _x getVariable ["realname",name _x]]; + _medicMarkers pushBack [_marker,_x]; +} forEach ((units independent) - [player]); + +{ + private _name = _x getVariable "name"; + private _down = _x getVariable ["Revive",false]; + if (!isNil "_name" && !_down) then { + private _marker = createMarkerLocal [format ["%1_dead_marker",_x],getPosATL _x]; + _marker setMarkerColorLocal "ColorRed"; + _marker setMarkerTypeLocal "loc_Hospital"; + _marker setMarkerTextLocal format ["%1",_name]; + _deadMarkers pushBack _marker; + }; +} forEach allDeadMen; + +while {visibleMap} do { + { + _x params [ + ["_mark",""], + ["_unit",objNull] + ]; + if !(isNull _unit) then { + _mark setMarkerPosLocal (getPosATL _unit); + }; + } forEach _medicMarkers; + uiSleep 0.01; +}; + +{ + _x params [["_mark",""]]; + deleteMarkerLocal _mark; +} forEach _medicMarkers; + +{ + deleteMarkerLocal _x; +} forEach _deadMarkers;