BIS fnc setServerVariable: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "<code>([^<]*)<nowiki\/>\[\[([a-zA-Z0-9_]+)\]\](.*)<\/code>" to "<code>$1$2$3</code>")
m (Some wiki formatting)
 
(One intermediate revision by the same user not shown)
Line 10: Line 10:
|s1= [namespace, varName, value] call [[BIS_fnc_setServerVariable]]
|s1= [namespace, varName, value] call [[BIS_fnc_setServerVariable]]


|p1= namespace: [[Namespace]] or [[Object]] or [[Group]] - (Optional, default [[missionNamespace]])
|p1= namespace: [[Namespace]], [[Object]] or [[Group]] - (Optional, default [[missionNamespace]])


|p2= varName: [[String]] - variable name
|p2= varName: [[String]] - variable name
Line 18: Line 18:
|r1= [[Boolean]] - [[true]] when done
|r1= [[Boolean]] - [[true]] when done


|x1= <code><nowiki>[</nowiki>[[nil]], "playerHealth", [[damage]] [[player]]] [[call]] [[BIS_fnc_setServerVariable]];</code>
|x1= <sqf>[nil, "playerHealth", damage player] call BIS_fnc_setServerVariable;</sqf>


|x2= <code>[player, "playerHealth", [[damage]] [[player]]] [[call]] [[BIS_fnc_setServerVariable]];</code>
|x2= <sqf>[player, "playerHealth", damage player] call BIS_fnc_setServerVariable;</sqf>


|seealso= [[BIS_fnc_getServerVariable]] [[publicVariableServer]] [[publicVariableClient]]
|seealso= [[BIS_fnc_getServerVariable]] [[publicVariableServer]] [[publicVariableClient]]
}}
}}

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