removeMissionEventHandler: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - " *\|MP *[Ee]ffects* *= * " to " ")
m (Text replacement - "\| *((\[\[[a-zA-Z0-9_ |()]+\]\],? ?)+) * \}\}" to "|seealso= $1 }}")
Line 28: Line 28:
[[removeMissionEventHandler]] ["Loaded", handler2]; {{cc|Remove the third index under type "Loaded"}}</code>
[[removeMissionEventHandler]] ["Loaded", handler2]; {{cc|Remove the third index under type "Loaded"}}</code>


| [[addMissionEventHandler]], [[removeAllMissionEventHandlers]]
|seealso= [[addMissionEventHandler]], [[removeAllMissionEventHandlers]]
}}
}}



Revision as of 00:01, 17 February 2021

Hover & click on the images for description

Description

Description:
Description needed
Groups:
Event Handlers

Syntax

Syntax:
Syntax needed
Parameters:
type: String
index: Number - Index is returned by addMissionEventHandler.
Return Value:
Return value needed

Examples

Example 1:
private _eventHandlerId = addMissionEventHandler ["Ended", { diag_log "mission complete"; }]; // ... removeMissionEventHandler ["Ended", _eventHandlerId];
Example 2:
for "_i" from 0 to 4 do { missionNamespace setVariable [format ["handler%1",_i], addMissionEventHandler ["Loaded","hint ""_i"";"]]; }; removeMissionEventHandler ["Loaded", handler2]; // Remove the third index under type "Loaded"

Additional Information

See also:
addMissionEventHandlerremoveAllMissionEventHandlers

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


Posted on August 6, 2015 - 22:02 (UTC)
SilentSpike
As of Arma 3 version 1.38 you can safely remove mission event handlers without worrying about decrementing higher indices.
EDIT: this command used to decrement other EH ids above the deleted one (e.g EH 0,1,2,3, delete EH 1, EH would be 0,1,2 now and not 0,2,3) - Lou Montana (talk) 19:29, 25 June 2020 (CEST)