add previous location check

If you had set a spawnpoint previously at another location and attempt
to set a new one, it would say "spawnpoint removed" instead of "set".
This commit is contained in:
vbawol 2017-03-24 07:24:35 -05:00
parent f4c0d24e42
commit 2c49a8ad93
8 changed files with 8 additions and 5 deletions

View File

@ -1 +1 @@
build=708;
build=709;

View File

@ -23,7 +23,10 @@ if (_player distance _jammer > 20) exitWith{};
if (alive _jammer) then {
if ((_jammer getVariable["BUILD_OWNER", "-1"]) in [getPlayerUID _player, _player getVariable["GROUP", ""]]) then {
_server_vars = _player getVariable["SERVER_VARS", []];
if (_server_vars param [0,[]] isEqualTo []) then {
_currentPos = _server_vars param [0,[]];
// invalidate previous position
if (_jammer distance _currentPos > 20) then { _currentPos = [] };
if (_currentPos isEqualTo []) then {
// set position of spawnpoint to players SERVER_VARS
_server_vars set [0, getposATL _jammer]; // 0 = RESPAWN POS
_player setVariable ["SERVER_VARS", _server_vars];

View File

@ -1 +1 @@
build=708;
build=709;

View File

@ -1 +1 @@
build=708;
build=709;

View File

@ -1 +1 @@
708
709