Jump to content
Palmi69

ARMA3 onMapSingleClick script

Recommended Posts

hi everyone,

 

on editor map: 

-a logic named "LogA" 

-a trigger with "radio alpha", "repeatable",  and "activation" execVM "Arty.sqf"; 

 

my Arty.sqf :  onMapSingleClick {LogA setPos _pos;[Player,Position LogA,3,50] spawn DAC_fCallArti;};

 

it works fine but the process is repeated  forever, how to do to stop process after only one click on map ? 

 

Thanks everyone for help

Edited by Palmi69

Share this post


Link to post
Share on other sites

No need for logic logA (for this script). You can:

onMapSingleClick {[Player,_pos,3,50] spawn DAC_fCallArti;};

 

Anyway, add a variable:
 

artyCount = 5;  // or else
onMapSingleClick {artyCount = artyCount -1; if (artyCount >=0) then {[Player,_pos,3,50] spawn DAC_fCallArti} };

 

You can do that with a boolean also:
 

onMapSingleClick {if (isNil "artyClick") then {artyClick = TRUE; [Player,_pos,3,50] spawn DAC_fCallArti} };

 

Prefer the stackable version. Other method:

addMissionEventHandler ["MapSingleClick", {
   params ["_units", "_pos", "_alt", "_shift"];
   [Player,_pos,3,50] spawn DAC_fCallArti;
   removeMissionEventHandler ["MapSingleClick",_thisEventHandler];
  }];

 

  • Like 1

Share this post


Link to post
Share on other sites
43 minutes ago, Palmi69 said:

how to do to stop process after only one click on map ?

onMapSingleClick {
	[Player,_pos,3,50] spawn DAC_fCallArti;
	onMapSingleClick "";  //Remove map click event
}; 

 

  • Like 1

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

×