BIS fnc getServerVariable: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
mNo edit summary
m (pf)
Line 1: Line 1:
{{Function|= Comments
{{Function|= Comments
____________________________________________________________________________________________
____________________________________________________________________________________________


| arma3 |= Game name
| arma 3 |= Game name


|1.00|= Game version
|1.00|= Game version
____________________________________________________________________________________________
____________________________________________________________________________________________


| <pre>/*
| Fetch a variable saved on server. Used when you want to share variables only to specific clients to prevent large traffic. Must be [[spawn|spawned]] because communication with server takes some time. |= Description
____________________________________________________________________________________________


Description:
| [target, varName, default] spawn [[BIS_fnc_getServerVariable]] |= Syntax
Fetch a variable saved on server.
____________________________________________________________________________________________
Used when you want to share variables only to specific clients to prevent large traffic.
Must be called in [[Scheduler#Scheduled_Environment|scheduled environment]] because communication with server takes some time.


Parameter(s):
|p1= target: [[Namespace]], [[Object]] or [[Group]] - Variable name space|= Parameter 1
0: NAMESPACE or OBJECT or GROUP - variable name space
|p2= varName: [[String]] - Variable name|= Parameter 2
1: STRING - variable name
|p3= varName: [[Anything]] - Default value returned when variable is [[nil]]|= Parameter 3
2: ANY - default used when variable value is nil
____________________________________________________________________________________________
|exec= spawn |= Execution
____________________________________________________________________________________________


Returns:
| [[Anything]] - Default value or saved variable|= Return value
ANY - variable value
*/
 
</pre><small>''(Placeholder description extracted from the function header by [[BIS_fnc_exportFunctionsToWiki]])''</small> |= Description
____________________________________________________________________________________________
____________________________________________________________________________________________


| <!-- [] call [[BIS_fnc_getServerVariable]]; --> |= Syntax
|x1= <code>[ [[missionNamespace]], "BIS_someVar", "defaultValue"] [[spawn]] [[BIS_fnc_getServerVariable]];</code> |=
 
|p1= |= Parameter 1
 
| |= Return value
____________________________________________________________________________________________
____________________________________________________________________________________________


|x1= <code></code> |=  
| [[getVariable]], [[setVariable]], [[allVariables]]|= See also }}
____________________________________________________________________________________________


| |= See also


}}


<h3 style="display:none">Notes</h3>
<h3 style="display:none">Notes</h3>

Revision as of 18:52, 2 June 2018

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 spawned because communication with server takes some time.
Execution:
spawn
Groups:
Uncategorised

Syntax

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

Examples

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

Additional Information

See also:
getVariablesetVariableallVariables

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

Bottom Section