CBA_fnc_setVarNet

Description

Same as setVariable [“name”,var, true] but only broadcasts when the value of var is different to the one which is already saved in the variable space.  Checks also for different types.  Nil as value gets always broadcasted.

Should reduce network traffic.

Parameters

_objectName of a marker [Object, Group]
_variableName of the variable in variable space [String]
_valueValue to check and broadcast if it is not the same as the previous one, code will always be broadcasted [Any]

Returns

True if broadcasted, otherwise false [Boolean]

Example

// This will only broadcast "somefish" if it either doesn't exist yet in the variable space or the value is not 50
_broadcasted = [player, "somefish", 50] call CBA_fnc_setVarNet;

Author

Xeno

Close