OFPEC Forum
Editors Depot - Mission Editing and Scripting => ArmA - Editing/Scripting General => Topic started by: loki72 on 31 May 2008, 09:54:26
-
greetings,
i am sure i could not be more vague.. however... ???
if i am in one spot, and i want to hit 'M' and click on the map to teleport to another area.. how would i?
if i had an addaction;
player addAction ["gotoA","scripts\tele.sqf"];
how does the onMapSingleClick connect to the addAction?
thanks
-
:blink:
You simply put the onMapSingleClick command inside the action script tele.sqf and a title text asking for map click.
// tele.sqf
titleText["Select Map Position", "PLAIN"];
onMapSingleClick "vehicle player setPos _pos; onMapSingleClick '';true;";
Note that onMapSingleClick ''; is with two single quotes.
-
:D
i laughed for 5 minutes... i had only wished it was that simple.. thank you.
-
Mandoble, is there any way to check for the "shift" inside the
titleText["Select Map Position", "PLAIN"];
onMapSingleClick "vehicle player setPos _pos; onMapSingleClick '';true;";
Perhaps:
titleText["Shift-Click Map Position", "PLAIN"];
onMapSingleClick "If (_shift) then {vehicle player setPos _pos; onMapSingleClick ''};;true;";
-
You may check for shift and alt (http://www.ofpec.com/COMREF/index.php?action=list&game=All&letter=o#239) states.
-
I don't think you understood the question I was asking, I meant is it possible within the scope of the OnMapSingleClick string/script to be executed, ie within the " ". Rather then launching another script to check for the states of _shift or _alt. Check the script I posted as a possibility, not sure whether it works, and am not unto the liberty to test it at this moment in time.