addPublicVariableEventHandler: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (VBS2 scripting category removal)
(mass edit: removing obsolete </dt> and </dd> tags)
Line 40: Line 40:
<!-- Note Section BEGIN -->
<!-- Note Section BEGIN -->


<dt class="note">'''[[User:TeRp|TeRp]]'''</dt>
<dt class="note">'''[[User:TeRp|TeRp]]'''
<dd class="note">
<dd class="note">
Please note that varName indicates which variable you want to monitor with this eventhandler.<br />
Please note that varName indicates which variable you want to monitor with this eventhandler.<br />
As a result, the example eventhandler on this page will only fire when the variable publicThis has been changed,
As a result, the example eventhandler on this page will only fire when the variable publicThis has been changed,
but not if any other variable was changed by any other client via the publicVariable command.  
but not if any other variable was changed by any other client via the publicVariable command.  
</dd>
 


<!--
<!--
<dt class="note">'''[[User:Anunnaki|Anunnaki]]'''</dt>
<dt class="note">'''[[User:Anunnaki|Anunnaki]]'''
<dd class="note">
<dd class="note">
Very important !
Very important !
addPublicVariableEventHandler does NOT WORK on dedicated server or player server! This is probaly bug in 1.09beta.
addPublicVariableEventHandler does NOT WORK on dedicated server or player server! This is probaly bug in 1.09beta.
</dd>


<dt class="note">'''[[User:Dennis|Dennis]]'''</dt>
 
<dt class="note">'''[[User:Dennis|Dennis]]'''
<dd class="note">
<dd class="note">
the event handler is not executed on JIP players machines
the event handler is not executed on JIP players machines
</dd>
 
-->
-->



Revision as of 17:49, 17 October 2011

-wrong parameter ("Arma") defined!-1.09
Hover & click on the images for description

Description

Description:
If the EH detects a change via publicVariable on the given variable, code will be executed. The following arguments are transferred to the code: _this select 0: variable name _this select 1: new variable value
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.
Groups:
Uncategorised

Syntax

Syntax:
varName addPublicVariableEventHandler code
Parameters:
varName: String
code: Code
Return Value:
Nothing

Examples

Example 1:
"publicThis" addPublicVariableEventHandler {hint ((_this select 0) + " has been updated to: " + str (_this select 1))}

Additional Information

See also:
publicVariable

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

Notes

TeRp
Please note that varName indicates which variable you want to monitor with this eventhandler.
As a result, the example eventhandler on this page will only fire when the variable publicThis has been changed, but not if any other variable was changed by any other client via the publicVariable command.

Bottom Section