Repentz

Player Marker & Group Markers Script

48 posts in this topic

Originally posted by ReMuS on another topic but not made as a post, didn't see that until this was made so credit goes to him, although I received this script from a friend so I was also not aware until now.

What does it do: Creates an updating marker on the map wherever you are, at all times, displaying your position and name. If anyone joins your group or you join someones group, markers are displayed for everyone in the group.

Create a new .sqf file named playerMarker, Inside place the code shown below

/*
playerMarker.sqf
*/
private["_markers","_members"];
_markers = [];
_members = [];

while {true} do {
	sleep 0.5;
	if(visibleMap) then {
		_members = units (group player);
		//Create markers
		{
			_marker = createMarkerLocal [format["%1_marker",_x],visiblePosition _x];
			_marker setMarkerColorLocal "ColorYellow";
			_marker setMarkerTypeLocal "Mil_dot";
			_marker setMarkerTextLocal format["%1", _x getVariable["realname",name _x]];
		
			_markers pushBack [_marker,_x];
		} foreach _members;
			
		while {visibleMap} do {
			{
				private["_marker","_unit"];
				_marker = _x select 0;
				_unit = _x select 1;
				if(!isNil "_unit") then {
					if(!isNull _unit) then {
					    _marker setMarkerPosLocal (visiblePosition _unit);
					};
				};
			} foreach _markers;
			if(!visibleMap) exitWith {};
			sleep 0.02;
		};

		{deleteMarkerLocal (_x select 0);} foreach _markers;
		_markers = [];
		_members = [];
	};
};

Now open Init.sqf, Place the below where your other execVM's are. You can call this file to wherever you like.

[] execVM "playerMarker.sqf";


Done.

You can also edit the marker color, sleep (for performance), etc if you know what you are doing.

Edited by Repentz
4 people like this

Share this post


Link to post
Share on other sites

Thanks for the re-post! If you (or anyone else actually!) have any other usefull scripts from the old forum could you let me know through a PM?

 

Thanks again man. Works like a charm.

Share this post


Link to post
Share on other sites
Advertisement

Does anyone wknow how I can add a direction to the icon? If I changed the icon to "mil_start" or something more appropriate, could I use something like...

_dir = round (getDir (vehicle player));

Im pretty new to this so would really appreciate any help!

Share this post


Link to post
Share on other sites

I changed the marker code as below to see direction:

 

//Create markers
		{
			_marker = createMarkerLocal [format["%1_marker",_x],visiblePosition _x];
			_marker setMarkerColorLocal "ColorBlue";
			_marker setMarkerTypeLocal "mil_triangle";
			_marker setMarkerTextLocal format["%1", _x getVariable["realname",name _x]];
			_marker setMarkerDirLocal (direction _x);
			_markers pushBack [_marker,_x];

 

2 people like this

Share this post


Link to post
Share on other sites

anyone know if i need to change my infistar to make this work?

/*  Check Global Markers */ _CGM = false;    /* true or false */    /* you may need to disable this check for A.I. Missions - or whitelist the used Markers in the _aLocalM Array beneath */
/*  Check Local Markers  */ _CLM = false;    /* true or false */    /* false if you do not want LocalMarker to be checked. */
/*  Use _aLocalM array   */ _UMW = false;    /* true or false */    /* use allowed marker array from below (for example AltisLife uses house_ and others in there) or A.I. Missions */
/* _aLocalM: if '_CLM' && _UMW - this array of names will be allowed */
   _aLocalM = ["DMS_MissionMarkerCircle","DMS_MissionMarkerDot"];

is what i have right now.

any assistance would be appreciated.

 

Share this post


Link to post
Share on other sites

anyone know if i need to change my infistar to make this work?

/*  Check Global Markers */ _CGM = false;    /* true or false */    /* you may need to disable this check for A.I. Missions - or whitelist the used Markers in the _aLocalM Array beneath */
/*  Check Local Markers  */ _CLM = false;    /* true or false */    /* false if you do not want LocalMarker to be checked. */
/*  Use _aLocalM array   */ _UMW = false;    /* true or false */    /* use allowed marker array from below (for example AltisLife uses house_ and others in there) or A.I. Missions */
/* _aLocalM: if '_CLM' && _UMW - this array of names will be allowed */
   _aLocalM = ["DMS_MissionMarkerCircle","DMS_MissionMarkerDot"];

is what i have right now.

any assistance would be appreciated.

 

I'm going to try this out too so any reply to this part would be appreciated.

1 person likes this

Share this post


Link to post
Share on other sites

Zitat von Remus auf einem anderen Thema geschrieben, aber nicht als Post gemacht, sahen nicht, dass bis zu diesem gemacht wurde, so Kredit geht zu ihm, obwohl ich erhielt dieses Skript von einem Freund, und so war ich auch nicht bewusst, bis jetzt.

Was ist zu tun: Erzeugt eine Aktualisierung Markierung auf der Karte, wo immer Sie sind, zu jeder Zeit, die Anzeige Ihrer Position und Namen. Wenn jemand Ihre Gruppe beitritt oder Sie someones Gruppe beizutreten, sind Marker für alle in der Gruppe angezeigt.

Erstellen Sie eine neue Datei mit dem Namen playerMarker .sqf, Innerhalb Ort unter der Code gezeigt


  

   
	  
		
		
		
		 
			
		   
			
				  
				  
					  
					
				
			 
			
		

		    
	

Öffnen Sie nun init.sqf, legen Sie die unten, wo Ihre anderen execVM sind. Sie können diese Datei, um wo immer Sie wollen nennen.


Fertig.

Sie können auch die Markierungsfarbe, schlafen (für die Leistung), etc. bearbeiten, wenn Sie wissen, was Sie tun.

Can not make it so the only work whom you hat a GPS

Share this post


Link to post
Share on other sites
Advertisement

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.