2023-09-12 18:58:10 +00:00
|
|
|
#include "..\script_component.hpp"
|
2015-01-11 16:42:31 +00:00
|
|
|
/*
|
|
|
|
* Author: commy2
|
|
|
|
* Sets a public object namespace variable that gets reset with the same value after respawn, so JIP clients keep the value.
|
|
|
|
*
|
2015-09-19 21:18:07 +00:00
|
|
|
* Arguments:
|
|
|
|
* 0: Object <OBJECT>
|
|
|
|
* 1: Variable name <STRING>
|
|
|
|
* 2: Any value <ANY>
|
2015-01-11 16:42:31 +00:00
|
|
|
*
|
2015-09-19 21:18:07 +00:00
|
|
|
* Return Value:
|
|
|
|
* None
|
|
|
|
*
|
2017-06-08 13:31:51 +00:00
|
|
|
* Example:
|
|
|
|
* [bob, "varname", 5] call ace_common_fnc_setVariableJIP
|
|
|
|
*
|
2015-09-19 21:18:07 +00:00
|
|
|
* Public: No
|
2015-01-11 16:42:31 +00:00
|
|
|
*/
|
|
|
|
|
2015-09-19 21:18:07 +00:00
|
|
|
params ["_unit", "_varName", "_value"];
|
2015-01-11 16:42:31 +00:00
|
|
|
|
2015-12-14 12:08:19 +00:00
|
|
|
private _respawnVariables = _unit getVariable ["ACE_respawnVariables", []];
|
2015-01-11 16:42:31 +00:00
|
|
|
|
|
|
|
if !(_varName in _respawnVariables) then {
|
2015-09-19 21:18:07 +00:00
|
|
|
_respawnVariables pushBack _varName;
|
|
|
|
_unit setVariable ["ACE_respawnVariables", _respawnVariables, true];
|
2015-01-11 16:42:31 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
_unit setVariable [_varName, _value, true];
|