Warning: file_put_contents(/ff_508b98f587b02549a8aef561aa5707383641bbf23c99ff99.php): failed to open stream: Permission denied in /home/ofpecsav/public_html/forum/Sources/Subs-ForumFirewall.php on line 1619
onMapSingleClick - OFPEC Scripting Command Reference | OFPEC The Editing Center

onMapSingleClick command

Operand types

command: String

Type of returned value

Description

Define action performed when user clicks in map.
Command receives:

_pos Array position
_units Array selected units
_shift, _alt Boolean key state

If click is processed, command should return true.

Used In

OFP/ArmA

Example

OFP: Two double quotes (or curly braces) are needed to define a string in OFP as it cannot use single quotes for this.

<span class="code">onMapSingleClick """SoldierWB"" createUnit [_pos, group player]; true;"</span>
or
<span class="code">onMapSingleClick {"SoldierWB" createUnit [_pos, group player]; true;}</span>

Arma:
<span class="code">onMapSingleClick "grp1 move _pos; leader grp1 sidechat "Moving"; variable1 = true; onMapSingleClick {};"</span>

ArmA:
<span class="code">onMapSingleClick "'SoldierEB' createUnit [_pos, group gamma]; true;"</span>

Advertisement