BIS fnc getServerVariable: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
mNo edit summary
m (Text replacement - "(\|[pr][0-9]+ *= *[^- ]*) *- *V([a-z ])" to "$1 - v$2")
 
(24 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{Function|Comments=
{{RV|type=function
____________________________________________________________________________________________


| arma 3 |Game name=
|game1= arma3
|version1= 1.00


|1.00|Game version=
|gr1= Variables


|gr1= Variables |GROUP1=
|descr= 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.


| 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=
|s1= [target, varName, default] call [[BIS_fnc_getServerVariable]]
____________________________________________________________________________________________


| [target, varName, default] call [[BIS_fnc_getServerVariable]] |SYNTAX=
|p1= target: [[Namespace]], [[Object]] or [[Group]] - variable name space
____________________________________________________________________________________________


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


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


|x1= <code>[ [[missionNamespace]], "BIS_someVar", "defaultValue"] [[call]] [[BIS_fnc_getServerVariable]];</code> |=
|r1= [[Anything]] - default value or saved variable
____________________________________________________________________________________________


| [[getVariable]], [[setVariable]], [[allVariables]]|SEEALSO= }}
|x1= <sqf>[missionNamespace, "BIS_someVar", "defaultValue"] call BIS_fnc_getServerVariable;</sqf>


 
|seealso= [[getVariable]] [[setVariable]] [[allVariables]]
 
}}
<h3 style="display:none">Notes</h3>
<dl class="command_description">
<!-- Note Section BEGIN -->
 
<!-- Note Section END -->
</dl>
 
<h3 style="display:none">Bottom Section</h3>
[[Category:Functions|{{uc:getServerVariable}}]]
[[Category:{{Name|arma3}}: Functions|{{uc:getServerVariable}}]]

Latest revision as of 15: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