Jump to navigation Jump to search
- Adds a multiplayer event handler (EH) to the given object and returns EH handle. See Event Handlers.
- Multiplayer EHs are added globally to every client and the server will fire on itself and every client upon event. The only exception is the MPRespawn EH that one only fires where the respawned unit is local. Make sure to check the EHs' locality in Event Handlers pages.
- MultiplayerEvent Handlers
- object addMPEventHandler [type, expression]
- object: Object - object to monitor
- type: String - event handler name
- expression: String or Code - Expression to execute.
If EH has some data to return upon event (e.g. the "MPKilled" EH will return an array with 2 elements: the killed unit, and the killer), it is passed in _this variable.
- Return Value:
- Number - event handler index
- Example 1: