BIS fnc addStackedEventHandler: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (syntax)
(Added the arguments as the fourth parameter)
Line 23: Line 23:


|p3= code: [[String]] or [[Code]] |= Parameter 3
|p3= code: [[String]] or [[Code]] |= Parameter 3
|p4= arguments: [[Anything]] - arguments to make available in code|= Parameter 4


| [[String]] |= Return value
| [[String]] |= Return value
Line 28: Line 30:
   
   
|x1= <code>["someId", "onEachFrame", { hintSilent str time; }] [[call]] [[BIS_fnc_addStackedEventHandler]];</code> |=  
|x1= <code>["someId", "onEachFrame", { hintSilent str time; }] [[call]] [[BIS_fnc_addStackedEventHandler]];</code> |=  
|x2= <code>["someId", "onEachFrame", { hintSilent str _this; }, "Hello world!"] [[call]] [[BIS_fnc_addStackedEventHandler]];</code> |=
____________________________________________________________________________________________
____________________________________________________________________________________________



Revision as of 00:09, 25 March 2014

Hover & click on the images for description

Description

Description:
Stack an event handler. Possible event handlers are:
  • "onEachFrame"
  • "onPlayerConnected"
  • "onPlayerDisconnected"
  • "onMapSingleClick"
  • "onPreloadStarted"
  • "onPreloadFinished"
Execution:
call
Groups:
Uncategorised

Syntax

Syntax:
[key, event, code] call BIS_fnc_addStackedEventHandler;
Parameters:
key: String - unique identifier
event: String - event handler type, see Description
code: String or Code
arguments: Anything - arguments to make available in code
Return Value:
String

Examples

Example 1:
["someId", "onEachFrame", { hintSilent str time; }] call BIS_fnc_addStackedEventHandler;
Example 2:
["someId", "onEachFrame", { hintSilent str _this; }, "Hello world!"] call BIS_fnc_addStackedEventHandler;

Additional Information

See also:
BIS_fnc_removeStackedEventHandler

Notes

Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord or on the Forums.
Only post proven facts here! Add Note

Notes

Posted on November 1, 2013
neokika
More info at: http://forums.bistudio.com/showthread.php?167822-Stacked-event-handlers-OnEachFrame-OnPlayerConnected-etc
Posted on February 11, 2014
Killzone_Kid
onMapSingleClick EH expects a Boolean. If you are planning to return true and override default behaviour, make sure it is added last.

Bottom Section