variableName addPublicVariableEventHandler code
Operand types
variableName:
Stringcode:
Code
Type of returned value
Description
If the EH detects a change via publicVariable on the given variableName, code will be executed.
The following arguments are transferred to the code:
* _this select 0: Variable name
* _this select 1: New variable value
Used In
ArmA
Example
"mypublicVar" addPublicVariableEventHandler {hint ((_this select 0) + " has been modified to: " + str (_this select 1))}
Multiplayer: Note that the EH is only fired on clients where the publicVariable command has not been executed, as publicVariable does not change the variable where it has been executed.