BIS fnc getServerVariable: Difference between revisions
Jump to navigation
Jump to search
Lou Montana (talk | contribs) m (Text replacement - " *\|= " to " ") |
Lou Montana (talk | contribs) m (Text replacement - " *\| *([Cc]omments|COMMENTS|[Gg]ame [Nn]ame|Game [Vv]ersion|Game Version \(number surrounded by NO SPACES\)|Multiplayer Arguments \("local" or "global"\)|Multiplayer Effects \("local" or "global"\)|Multiplayer Execution \("server" o...) |
||
Line 1: | Line 1: | ||
{{Function | {{Function | ||
| arma3 | | arma3 | ||
|1.00 | |1.00 | ||
|gr1= Variables | |gr1= Variables | ||
| 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. | ||
| [target, varName, default] call [[BIS_fnc_getServerVariable]] | | [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]] | ||
|exec= call |Execution= | |exec= call |Execution= | ||
| [[Anything]] - Default value or saved variable | | [[Anything]] - Default value or saved variable | ||
|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> |
Revision as of 22:59, 17 January 2021
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