Advertisement
Guest User

Untitled

a guest
Apr 10th, 2020
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.26 KB | None | 0 0
  1. /*
  2. File: fn_copMarkers.sqf
  3. Author: Bryan "Tonic" Boardwine
  4.  
  5. Description:
  6. Marks cops on the map for other cops. Only initializes when the actual map is open.
  7. */
  8. private ["_markers","_cops"];
  9. _markers = [];
  10. _cops = [];
  11.  
  12. sleep 0.5;
  13. if (visibleMap) then {
  14. {if (side _x isEqualTo west) then {_cops pushBack _x;}} forEach playableUnits; //Fetch list of cops / blufor
  15.  
  16. //Create markers
  17. {
  18. if !(_x isEqualTo player) then {
  19. _marker = createMarkerLocal [format ["%1_marker",_x],visiblePosition _x];
  20. _marker setMarkerColorLocal "ColorBLUFOR";
  21. _marker setMarkerTypeLocal "Mil_dot";
  22. _marker setMarkerTextLocal format ["%1", _x getVariable ["realname",name _x]];
  23.  
  24. _markers pushBack [_marker,_x];
  25. };
  26. } forEach _cops;
  27.  
  28. while {visibleMap} do {
  29. {
  30. private ["_unit"];
  31. _unit = _x select 1;
  32. if (!isNil "_unit" && !isNull _unit) then {
  33. (_x select 0) setMarkerPosLocal (visiblePosition _unit);
  34. };
  35. } forEach _markers;
  36. if (!visibleMap) exitWith {};
  37. sleep 0.02;
  38. };
  39.  
  40. {deleteMarkerLocal (_x select 0);} forEach _markers;
  41. _markers = [];
  42. _cops = [];
  43. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement