Jump to content
Sign in to follow this  
fusion13

onMapSingleClick

Recommended Posts

How could I make it so that onMapSingleClick can be used multiple time in one file to make three different markers? I have so far

onMapSingleClick {createMarker ["bomber", _pos];};

I wanna make a onMapSingleClick for createMarker "bomber2" and "bomber3" this possible? :yay::bounce3:

Share this post


Link to post
Share on other sites

add this line

onMapSingleClick {createMarker ["bomber", _pos];};

"bomber" setMarkerType "Arrow";

Share this post


Link to post
Share on other sites

But how dose that allow me to make several markers in one .sqf? using the OnMapSingleClick

Share this post


Link to post
Share on other sites

With onMapSingleClick, does anyone know if there's a way to 'escape' out of the command and drop out of it with another key stroke other than a mouse click?

Share this post


Link to post
Share on other sites

@ Meatball try

while {![b]VisableMap[/b]} do {
[b]showMap[/b] True;   
onMapSingleClick your block ofcode... ;
waitUntil {{[b]VisableMap[/b]}};};

or opposite ! on waituntil side... not tested for sure.

with this i think that if you close the map , then the script ends/continue next line of code....

Edited by dragonsyr

Share this post


Link to post
Share on other sites

Ah, perfect, thanks! I had a waituntil already in there waiting for the singleClick so I just added in 'or !(visibleMap)' and then added an if statement right after that doing an exitwith if !visiblemap and cancelling the onMapSingleClick.

Share this post


Link to post
Share on other sites

@Dragonsyr

Use your script and do a test.

Open the map by your script. Close the map (Yes, your script is canceled at this moment). Open the map again (but not by your script !!! ) and do a single click. See what happend...

Why? The waitUntil-command is behind you onClick command. And this is still in your memory. To avoid this, i set a variable to nil.

openMap [true, false];
titleText ["Senden sie die Koordinaten (Einfack-Klick auf Karte)","PLAIN",1];
onMapSingleClick "[color="#0000FF"]ari_ziel = _pos;[/color][color="#00FF00"] anforderung = true;[/color]  onMapSingleClick ''; true;"; 
waitUntil {!visibleMap || [color="#00FF00"]anforderung[/color]};
if (!anforderung) exitWith 
{titleText ["","PLAIN",0.5];
[color="#0000FF"]ari_ziel = nil;[/color]
hint "Unterstützungsanforderung abgebrochen";};

You can work around only with !visibleMap, sure, but you need one step, to set the clickpos to nil.

Share this post


Link to post
Share on other sites

this is not for me Drunken Officer,

i never tested that i send, btw , problem is solved for meatball (see above)

thanks anyway...

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  

×