BIS fnc getServerVariable: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "| arma 3 |Game name=" to "| arma3 |Game name=")
m (Text replacement - "_{10,} " to "")
Line 1: Line 1:
{{Function|Comments=
{{Function|Comments=
____________________________________________________________________________________________


| arma3 |Game name=
| arma3 |Game name=
Line 7: Line 6:


|gr1= Variables |GROUP1=
|gr1= Variables |GROUP1=
____________________________________________________________________________________________


| 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 [[Scheduler#Scheduled_Environment|scheduled environment]] because communication with server takes some time. |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 [[Scheduler#Scheduled_Environment|scheduled environment]] because communication with server takes some time. |DESCRIPTION=
____________________________________________________________________________________________


| [target, varName, default] call [[BIS_fnc_getServerVariable]] |SYNTAX=
| [target, varName, default] call [[BIS_fnc_getServerVariable]] |SYNTAX=
____________________________________________________________________________________________


|p1= target: [[Namespace]], [[Object]] or [[Group]] - Variable name space|PARAMETER1=
|p1= target: [[Namespace]], [[Object]] or [[Group]] - Variable name space|PARAMETER1=
|p2= varName: [[String]] - Variable name|PARAMETER2=
|p2= varName: [[String]] - Variable name|PARAMETER2=
|p3= default: [[Anything]] - Default value returned when variable is [[nil]]|PARAMETER3=
|p3= default: [[Anything]] - Default value returned when variable is [[nil]]|PARAMETER3=
____________________________________________________________________________________________
|exec= call |Execution=
|exec= call |Execution=
____________________________________________________________________________________________


| [[Anything]] - Default value or saved variable|RETURNVALUE=
| [[Anything]] - Default value or saved variable|RETURNVALUE=
____________________________________________________________________________________________


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


| [[getVariable]], [[setVariable]], [[allVariables]]|SEEALSO= }}
| [[getVariable]], [[setVariable]], [[allVariables]]|SEEALSO= }}

Revision as of 23:10, 16 January 2021

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:
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