BIS fnc getServerVariable: Difference between revisions
Jump to navigation
Jump to search
Lou Montana (talk | contribs) m (Text replacement - "| arma 3 |Game name=" to "| arma3 |Game name=") |
Lou Montana (talk | contribs) m (Text replacement - "(\|[pr][0-9]+ *= *[^- ]*) *- *V([a-z ])" to "$1 - v$2") |
||
(22 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
{{ | {{RV|type=function | ||
| arma3 | | |game1= arma3 | ||
|version1= 1.00 | |||
| | |gr1= Variables | ||
| | |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. | |||
| | |s1= [target, varName, default] call [[BIS_fnc_getServerVariable]] | ||
| [ | |p1= target: [[Namespace]], [[Object]] or [[Group]] - variable name space | ||
|p2= varName: [[String]] - variable name | |||
|p2= varName: [[String]] - | |||
| [[Anything]] - | |p3= default: [[Anything]] - default value returned when variable is [[nil]] | ||
| | |r1= [[Anything]] - default value or saved variable | ||
| [ | |x1= <sqf>[missionNamespace, "BIS_someVar", "defaultValue"] call BIS_fnc_getServerVariable;</sqf> | ||
|seealso= [[getVariable]] [[setVariable]] [[allVariables]] | |||
}} | |||
[[ | |||
[[ |
Latest revision as of 15:53, 8 November 2023
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:
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