BIS fnc setServerVariable: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Generated by BIS_fnc_exportFunctionsToWiki)
 
m (Some wiki formatting)
 
(30 intermediate revisions by 5 users not shown)
Line 1: Line 1:
{{RV|type=function


{{Function|= Comments
|game1= arma3
____________________________________________________________________________________________
|version1= 1.00


| arma3 |= Game name
|gr1= Variables


|1.00|= Game version
|descr= Set variable stored only on server. Clients can the download it using [[BIS_fnc_getServerVariable]]. Used when you want to share variables only to specific clients to prevent large traffic.
____________________________________________________________________________________________


| <pre>/*
|s1= [namespace, varName, value] call [[BIS_fnc_setServerVariable]]


Description:
|p1= namespace: [[Namespace]], [[Object]] or [[Group]] - (Optional, default [[missionNamespace]])
Set variable stored only on server.
Clients can the download it using BIS_fnc_getServerVariable.
Used when you want to share variables only to specific clients to prevent large traffic.


Parameter(s):
|p2= varName: [[String]] - variable name
0: NAMESPACE or OBJECT or GROUP - variable name space
1: STRING - variable name
2: ANY - value


Returns:
|p3= value: [[Anything]] - variable value
BOOL
*/


</pre><small>''(Placeholder description extracted from the function header by [[BIS_fnc_exportFunctionsToWiki]])''</small> |= Description
|r1= [[Boolean]] - [[true]] when done
____________________________________________________________________________________________


| <!-- [] call [[BIS_fnc_setServerVariable]]; --> |= Syntax
|x1= <sqf>[nil, "playerHealth", damage player] call BIS_fnc_setServerVariable;</sqf>


|p1= |= Parameter 1
|x2= <sqf>[player, "playerHealth", damage player] call BIS_fnc_setServerVariable;</sqf>
 
| |= Return value
____________________________________________________________________________________________
 
|x1= <code></code> |=
____________________________________________________________________________________________
 
| |= See also


|seealso= [[BIS_fnc_getServerVariable]] [[publicVariableServer]] [[publicVariableClient]]
}}
}}
<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:Function Group: Variables|{{uc:setServerVariable}}]]
[[Category:Functions|{{uc:setServerVariable}}]]
[[Category:{{Name|arma3}}: Functions|{{uc:setServerVariable}}]]

Latest revision as of 13:34, 13 July 2022

Hover & click on the images for description

Description

Description:
Set variable stored only on server. Clients can the download it using BIS_fnc_getServerVariable. Used when you want to share variables only to specific clients to prevent large traffic.
Execution:
call
Groups:
Variables

Syntax

Syntax:
[namespace, varName, value] call BIS_fnc_setServerVariable
Parameters:
namespace: Namespace, Object or Group - (Optional, default missionNamespace)
varName: String - variable name
value: Anything - variable value
Return Value:
Boolean - true when done

Examples

Example 1:
[nil, "playerHealth", damage player] call BIS_fnc_setServerVariable;
Example 2:
[player, "playerHealth", damage player] call BIS_fnc_setServerVariable;

Additional Information

See also:
BIS_fnc_getServerVariable publicVariableServer publicVariableClient

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