Jump to content
Sign in to follow this  
alleycat

Question about placing several markers

Recommended Posts

while {true} do
{





{ 
	 if ((_x isKindOf "Man") and (isPlayer _x)) then 
	 { 
		_markerstr = createMarker ["markername",getpos _x];
		_markerstr setMarkerShape "ICON";
		_markerstr setMarkerType "mil_dot";		 






	 }; 
} forEach Allunits; 


sleep 10;

};

this is supposed to place a marker every 10 seconds on the player position. However it only places one the first time and then stops placing, although the loop is still running. Any advice? I want it to place a new marker for every new sequence of the loop.

Share this post


Link to post
Share on other sites

Probably due to every marker name having to be unique. You have to generate a new name each time:

[b]_markercount = 0;[/b]

while {true} do
{
{ 
	 if ((_x isKindOf "Man") and (isPlayer _x)) then 
	 {
		_markerstr = createMarker [[b][url="https://community.bistudio.com/wiki/format"]format[/url] ["markername%1", _markercount][/b], getpos _x];
		_markerstr setMarkerShape "ICON";
		_markerstr setMarkerType "mil_dot";	
		[b]_markercount = _markercount + 1;[/b]
	 }; 
} forEach Allunits; 

sleep 10;
};

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×