Announcement

Collapse
No announcement yet.

All Players Markers

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • All Players Markers

    This places markers on all players when a player opens the map. fr33bird did all the heavy lifting of course, I just wrote a really long complicated script that wouldn't delete markers which he probably ignored lolz.

    Anywho, from your TG ArmA Projects Team....

    playerMarkers.sqf
    Code:
    //playerMarkers.sqf
    //script by the TG Arma Projects Team (fr33bird & Unkl)
    /*
    //Place the following in your init.sqf
    if ( !isNull player ) then {
    	[] execVM "TG\playerMarkers.sqf";
    	player addMPEventHandler ["RESPAWN", "TG\playerMarkers.sqf"];
    };
    
    if (!isServer && isNull player) then
    {
    	waitUntil {!isNull player};
    	waitUntil {time > 10};
    	[] execVM "TG\playerMarkers.sqf";
    	player addMPEventHandler ["RESPAWN", "TG\playerMarkers.sqf"];
    };
    */
    //actually added execVM "TG\playerMarkers.sqf" in the R3F Revive module "onKilled.sqf" instead of using an event handler - Unk
    
    
    private ["_thisMarker","_thisUnitName","_count", "_markerArray"];
    waitUntil { alive player };
    while { alive player } do {
        
        waitUntil { sleep 1; visibleMap };
        _count = false;
    	_markerArray = [];
        
        while { visibleMap } do {
    	    if ( _count ) then {
                {
    				deleteMarkerLocal _x;              
                } forEach _markerArray;
    			_markerArray = [];
            } else { 
                _count = true; 
            };
            
            {
                if ( side _x == side player ) then {
                    _thisUnitName = format [ "%1", name _x ];
                    _thisMarker = createMarkerLocal [ _thisUnitName,  getPos _x ];
                    _thisMarker setMarkerShapeLocal "ICON";
                    _thisMarker setMarkerTypeLocal "dot";
                    _thisMarker setMarkerTextLocal _thisUnitName;
                    _thisMarker setMarkerColorLocal "ColorBlue";
    				
    				_markerArray set [ count _markerArray, _thisUnitName ];
                };
            } forEach playableUnits;
            
            sleep 5; 
        };
    	
    	{
    		deleteMarkerLocal _x; 
    	} forEach _markerArray;
    	
    };
    |TG-189th| Unkl
    ArmA 3 Game Officer
    Dean of Tactical Gamer University
    189th Infantry Brigade Member
    SUBMIT A RIBBON NOMINATION OR CONTACT AN ARMA ADMIN
    "We quickly advance in the opposite direction and take cover in a house on the SW side of town." - BadStache

  • #2
    Re: All Players Markers

    Interesting. So these only update when you open your map, not constantly?
    "Anyone who has never made a mistake has never tried anything new."
    -Einstein

    Comment


    • #3
      Re: All Players Markers

      that was the idea to try to optimize processes, don't know if i was right in doing so though

      this is the same script just cleaned up, its tested unkl should update yours

      Code:
          private ["_thisMarker","_thisUnitName","_myBool", "_markerArray"];
          waitUntil { alive player };
          while { alive player } do {
           
            waitUntil { sleep 1; visibleMap };
           
            while { visibleMap } do {
           
              _markerArray = [];
           
              {
                if ( side _x == side player ) then {
                  _thisUnitName = format [ "%1", name _x ];
                  _thisMarker = createMarkerLocal [ _thisUnitName,  getPos _x ];
                  _thisMarker setMarkerShapeLocal "ICON";
                  _thisMarker setMarkerTypeLocal "dot";
                  _thisMarker setMarkerTextLocal _thisUnitName;
                  _thisMarker setMarkerColorLocal "ColorBlue";
           
                  _markerArray set [ count _markerArray, _thisUnitName ];
                };
              } forEach playableUnits;
           
              sleep 5;
             
              { deleteMarkerLocal _x; } forEach _markerArray;
           
            };
           
          };

      Comment

      Connect

      Collapse

      TeamSpeak 3 Server

      Collapse

      Advertisement

      Collapse

      Twitter Feed

      Collapse

      Working...
      X