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.
|
|
|
|
*
|
|
|
|
* Argument:
|
|
|
|
* 0: Object (Object)
|
|
|
|
* 1: Variable name (String)
|
|
|
|
* 2: Any value (Anything)
|
|
|
|
*
|
|
|
|
* Return value:
|
|
|
|
* Nothing.
|
|
|
|
*/
|
2015-01-13 19:56:02 +00:00
|
|
|
#include "script_component.hpp"
|
2015-01-11 16:42:31 +00:00
|
|
|
|
2015-05-14 18:06:06 +00:00
|
|
|
private ["_respawnVariables"];
|
2015-01-11 16:42:31 +00:00
|
|
|
|
2015-05-14 18:06:06 +00:00
|
|
|
PARAMS_3(_unit,_varName,_value);
|
2015-01-11 16:42:31 +00:00
|
|
|
|
2015-01-12 04:02:33 +00:00
|
|
|
_respawnVariables = _unit getVariable ["ACE_respawnVariables", []];
|
2015-01-11 16:42:31 +00:00
|
|
|
|
|
|
|
if !(_varName in _respawnVariables) then {
|
|
|
|
_respawnVariables pushBack _varName;
|
2015-01-12 04:02:33 +00:00
|
|
|
_unit setVariable ["ACE_respawnVariables", _respawnVariables, true];
|
2015-01-11 16:42:31 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
_unit setVariable [_varName, _value, true];
|