BIS fnc getServerVariable: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "= <code>([^<]*)\[\[([a-zA-Z][a-zA-Z0-_]+)\]\]([^<]*)<\/code>" to "= <code>$1$2$3</code>")
m (Text replacement - "(\|[pr][0-9]+ *= *[^- ]*) *- *V([a-z ])" to "$1 - v$2")
 
(2 intermediate revisions by the same user not shown)
Line 12: Line 12:
|s1= [target, varName, default] call [[BIS_fnc_getServerVariable]]
|s1= [target, varName, default] call [[BIS_fnc_getServerVariable]]


|p1= target: [[Namespace]], [[Object]] or [[Group]] - Variable name space
|p1= target: [[Namespace]], [[Object]] or [[Group]] - variable name space


|p2= varName: [[String]] - Variable name
|p2= varName: [[String]] - variable name


|p3= default: [[Anything]] - Default value returned when variable is [[nil]]
|p3= default: [[Anything]] - default value returned when variable is [[nil]]


|r1= [[Anything]] - Default value or saved variable
|r1= [[Anything]] - default value or saved variable


|x1= <code>[missionNamespace, "BIS_someVar", "defaultValue"] call BIS_fnc_getServerVariable;</code>
|x1= <sqf>[missionNamespace, "BIS_someVar", "defaultValue"] call BIS_fnc_getServerVariable;</sqf>


|seealso= [[getVariable]] [[setVariable]] [[allVariables]]
|seealso= [[getVariable]] [[setVariable]] [[allVariables]]
}}
}}

Latest revision as of 16:53, 8 November 2023

Hover & click on the images for description

Description

Description:
Fetch a variable saved on server. Used when you want to share variables only to specific clients to prevent large traffic. Must be run in scheduled environment because communication with server takes some time.
Execution:
call
Groups:
Variables

Syntax

Syntax:
[target, varName, default] call BIS_fnc_getServerVariable
Parameters:
target: Namespace, Object or Group - variable name space
varName: String - variable name
default: Anything - default value returned when variable is nil
Return Value:
Anything - default value or saved variable

Examples

Example 1:
[missionNamespace, "BIS_someVar", "defaultValue"] call BIS_fnc_getServerVariable;

Additional Information

See also:
getVariable setVariable allVariables

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