BIS fnc addScriptedEventHandler: Difference between revisions
Jump to navigation
Jump to search
Lou Montana (talk | contribs) m (Text replacement - " <h3 style="display:none">Notes</h3> <dl class="command_description"> <!-- Note Section BEGIN --> <!-- Note Section END --> </dl>" to "") |
Lou Montana (talk | contribs) m (Text replacement - " *\| *([Cc]omments|COMMENTS|[Gg]ame [Nn]ame|Game [Vv]ersion|Game Version \(number surrounded by NO SPACES\)|Multiplayer Arguments \("local" or "global"\)|Multiplayer Effects \("local" or "global"\)|Multiplayer Execution \("server" o...) |
||
Line 1: | Line 1: | ||
{{Function | {{Function | ||
| arma3 | | arma3 | ||
|1.00 | |1.00 | ||
|gr1= Event Handlers | |gr1= Event Handlers | ||
| Adds scripted event handler and returns its id. Additionally "ScriptedEventHandlerAdded" scripted EH is called. For the list of available scripted event handlers see [[Arma 3: Event Handlers/ScriptedEventHandlers]]. | | Adds scripted event handler and returns its id. Additionally "ScriptedEventHandlerAdded" scripted EH is called. For the list of available scripted event handlers see [[Arma 3: Event Handlers/ScriptedEventHandlers]]. | ||
| [namespace, name, code] call [[BIS_fnc_addScriptedEventHandler]] | | [namespace, name, code] call [[BIS_fnc_addScriptedEventHandler]] | ||
|p1= namespace: [[Namespace]], [[Object]], [[Group]], [[Location]], [[Boolean]], [[Control]] or [[Display]] - namespace in which handler is saved | |p1= namespace: [[Namespace]], [[Object]], [[Group]], [[Location]], [[Boolean]], [[Control]] or [[Display]] - namespace in which handler is saved | ||
|p2= name: [[String]] - handler name | |p2= name: [[String]] - handler name | ||
|p3= code: [[Code]] or [[String]] - code executed upon calling | |p3= code: [[Code]] or [[String]] - code executed upon calling | ||
| [[Number]] - id of the currently added event handler | | [[Number]] - id of the currently added event handler | ||
|x1= <code>[<nowiki/>[[missionNamespace]], "event", { [[hint]] "Hello World" }] [[call]] [[BIS_fnc_addScriptedEventHandler]];</code> | |x1= <code>[<nowiki/>[[missionNamespace]], "event", { [[hint]] "Hello World" }] [[call]] [[BIS_fnc_addScriptedEventHandler]];</code> | ||
|x2= <code>[<nowiki/>[[true]], "event", { [[hint]] "Hello World" }] [[call]] [[BIS_fnc_addScriptedEventHandler]];</code> | |x2= <code>[<nowiki/>[[true]], "event", { [[hint]] "Hello World" }] [[call]] [[BIS_fnc_addScriptedEventHandler]];</code> | ||
Boolean will default to [[missionNamespace]] | Boolean will default to [[missionNamespace]] | ||
| [[BIS_fnc_callScriptedEventHandler]], [[BIS_fnc_removeScriptedEventHandler]], [[BIS_fnc_removeAllScriptedEventHandlers]] | | [[BIS_fnc_callScriptedEventHandler]], [[BIS_fnc_removeScriptedEventHandler]], [[BIS_fnc_removeAllScriptedEventHandlers]] | ||
}} | }} | ||
Revision as of 23:38, 17 January 2021
Description
- Description:
- Adds scripted event handler and returns its id. Additionally "ScriptedEventHandlerAdded" scripted EH is called. For the list of available scripted event handlers see Arma 3: Event Handlers/ScriptedEventHandlers.
- Execution:
- call
- Groups:
- Event Handlers
Syntax
- Syntax:
- [namespace, name, code] call BIS_fnc_addScriptedEventHandler
- Parameters:
- namespace: Namespace, Object, Group, Location, Boolean, Control or Display - namespace in which handler is saved
- name: String - handler name
- code: Code or String - code executed upon calling
- Return Value:
- Number - id of the currently added event handler
Examples
- Example 1:
[missionNamespace, "event", { hint "Hello World" }] call BIS_fnc_addScriptedEventHandler;
- Example 2:
[true, "event", { hint "Hello World" }] call BIS_fnc_addScriptedEventHandler;
Boolean will default to missionNamespace
Additional Information
- See also:
- BIS_fnc_callScriptedEventHandlerBIS_fnc_removeScriptedEventHandlerBIS_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