removeMissionEventHandler: Difference between revisions
Jump to navigation
Jump to search
Lou Montana (talk | contribs) m (Text replacement - "\| *arma3 * * *\| *([0-2]\.[0-9]{2}) * " to "|game1= arma3 |version1= $1 ") |
Lou Montana (talk | contribs) m (Text replacement - " \| *(game[0-9]|version[0-9]|gr[0-9]|serverExec|mp|pr|descr|s[0-9]|p[0-9]{1,3}|r[0-9]|x1?[0-9]|seealso) *= +" to " |$1= ") |
||
Line 10: | Line 10: | ||
|descr= Removes mission event handler added by [[addMissionEventHandler]]. | |descr= Removes mission event handler added by [[addMissionEventHandler]]. | ||
|s1= | |s1= [[removeMissionEventHandler]] [type, index] | ||
|p1= type: [[String]] | |p1= type: [[String]] |
Revision as of 22:29, 19 June 2021
Description
- Description:
- Removes mission event handler added by addMissionEventHandler.
- Groups:
- Event Handlers
Syntax
- Syntax:
- removeMissionEventHandler [type, index]
- Parameters:
- type: String
- index: Number - Index is returned by addMissionEventHandler.
- Return Value:
- Nothing
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
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)