BIS_fnc_addScriptedEventHandler

From Bohemia Interactive Community
Revision as of 21:18, 18 May 2016 by RageBone (talk | contribs) (syntax, parameters, and examples, see also)
Jump to navigation Jump to search


Hover & click on the images for description

Description

Description:
/*

	Description:
	Add scripted event handler

	Parameter(s):
		0: NAMESPACE, OBJECT, GROUP or LOCATION - namespace in which handler is saved
		1: STRING - handler name
		2: CODE or STRING - code executed upon calling

	Returns:
	NUMBER - handler ID
*/
(Placeholder description extracted from the function header by BIS_fnc_exportFunctionsToWiki)
Execution:
call
Groups:
Uncategorised

Syntax

Syntax:
[missionNamespace,"",""] call BIS_fnc_addScriptedEventHandler;
Parameters:
NAMESPACE, OBJECT, GROUP LOCATION or BOOLEAN - namespace in which handler is saved
STRING - handler name
CODE or STRING - code executed upon calling
Return Value:
Number - The index of the currently added event handler is returned. Indices start at 0 for each unit and increment with each added event handler.

Examples

Example 1:
[missionNamespace,"event",{hint "Hello World";}] call bis_fnc_addScriptedEventhandler;
Example 2:
stacking code:[missionNamespace,"event",{STRING "Hello World";}] call BIS_fnc_addScriptedEventhandler; [missionNamespace,"event",{hint STRING;}] call BIS_fnc_addScriptedEventhandler; [missionNamespace,"event",[]] call BIS_fnc_callScriptedEventHandler; will show "Hello World" on screen.
Example 3:
[true,"event",{hint "Hello World";}] call bis_fnc_addScriptedEventhandler; Boolean will default to misionNameSpace

Additional Information

See also:
BIS_fnc_callScriptedEventHandler BIS_fnc_removeScriptedEventHandler BIS_fnc_removeAllScriptedEventHandlers

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

Bottom Section