Difference between revisions of "getVariable"

From Bohemia Interactive Community
Jump to navigation Jump to search
m (template:command argument fix)
m (Text replacement - "|= Comments" to "|Comments=")
Line 1: Line 1:
{{Command|= Comments

Revision as of 14:49, 31 August 2019



Bottom Section

Posted on August 13, 2016 - 17:13 (UTC)
NOTE: Arma 2 ONLY! In Arma 3 this will return default value. Warning: the alternative syntax returns undefined when the varspace is an object and that object is null. Example:
_test = objNull getVariable ["test","0"]; systemChat _test; Errors because _test is undefined. Tested in A2OA 1.63.131129
Posted on August 31, 2017 - 03:29 (UTC)
You can do typechecking using param: private _myVar = [player getVariable "myVar"] param [0,"",[""]]; and params: [player getVariable "myVar"] params [["_myVar","",[""]]];