ACE3/addons/common/functions/fnc_setParameter.sqf

32 lines
623 B
Plaintext
Raw Normal View History

#include "..\script_component.hpp"
/*
2015-03-24 04:18:00 +00:00
* Author: esteldunedain
* Sets the value of an ACE_Parameter and makes it public.
*
* Arguments:
2015-09-19 18:55:35 +00:00
* 0: Parameter name <STRING>
* 1: Value <BOOL, NUMBER>
*
* Return Value:
* None
2015-09-19 18:55:35 +00:00
*
* Example:
* ["Name", 5] call ace_common_fnc_setParameter
*
2015-09-19 18:55:35 +00:00
* Public: Yes
*
2015-09-20 13:52:40 +00:00
* Deprecated
*/
2015-09-19 18:55:35 +00:00
params ["_name", "_value"];
// Hack to keep backward compatibility for the moment
2015-09-19 18:55:35 +00:00
if (typeName (missionNamespace getVariable _name) == "BOOL") then {
if (_value isEqualType 0) then {
2015-05-14 18:06:06 +00:00
_value = _value > 0;
};
};
missionNamespace setVariable [_name, _value];
publicVariable _name;