addMPEventHandler

From Bohemia Interactive Community
Jump to: navigation, search
Introduced with Arma 2: Operation Arrowhead version 1.55
  Arguments of this scripting command don't have to be local to the client the command is executed onEffects of this scripting command are broadcasted over the network and happen on every computer in the network

Click on the images for descriptions

Introduced in

Game:
Arma 2: Operation Arrowhead
Version:
1.55

Description

Description:
Adds MP event handler (EH) to the given object and returns EH handle. MP event handlers are added globally to every client on network in multiplayer and will fire on every client too upon event. 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. Since Arma 3 v.1.63.137807 the EH handle is also stored in _thisEventHandler variable and is available during EH code execution.

For more information see: Arma_3:_Event_Handlers#addMPEventHandler

Syntax

Syntax:
object addMPEventHandler [type, expression]
Parameters:
object: Object - object to monitor
[type, expression]: Array
type: String - event handler name
expression: String or Code - expression to execute
Return Value:
Number

Examples

Example 1:
_index = player addMPEventHandler ["mpkilled", {Null = _this execVM "playerkilled.sqf";}];

Additional Information

Multiplayer:
-
See also:
EventHandlers listremoveMPEventHandlerremoveAllMPEventHandlers

Notes

Only post proven facts here. Report bugs on the feedback tracker. Use the talk page or the forums for discussions.
Add New Note | How To

Notes

Bottom Section

Posted on May 8, 2015 - 12:24 (UTC)
Killzone Kid
MP EHs are added on every PC and execute on every PC, apart from MPRespawn, that only executes at the locality where unit respawns.