OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: GeneralCoder on 17 Mar 2003, 14:33:15
-
How can I get the position where user clicked the map?
what I tryed was this:
OnMapSingleClick _pos
but the result is just 'anything' ???
-
The argument of onMapSingleClick must be a code string. The code within the string is executed everytime the player clicks the map. Within the code string, the variables _pos, _alt, _shift, _units are reserved and represent the click position, the status of the ALT and SHIFT buttons (true or false), and an array of the selected units, respecively. E.g.:
onMapSingleClick {[_pos, _shift, _alt, _units] exec "detectClick.sqs"}This simply calls the script "detectClick.sqs" upon map click, and all the relevant paramters are passed as arguments into the script, e.g. _pos = _this select 0.
-
The argument of onMapSingleClick must be a code string. The code within the string is executed everytime the player clicks the map. Within the code string, the variables _pos, _alt, _shift, _units are reserved and represent the click position, the status of the ALT and SHIFT buttons (true or false), and an array of the selected units, respecively. E.g.:
onMapSingleClick {[_pos, _shift, _alt, _units] exec "detectClick.sqs"}This simply calls the script "detectClick.sqs" upon map click, and all the relevant paramters are passed as arguments into the script, e.g. _pos = _this select 0.
allright thanks!