From e181ae2425b8bf5d1fedf5a33ed47952200832b1 Mon Sep 17 00:00:00 2001 From: 82ndab-Bravo17 <82ndab.bravo17@gmail.com> Date: Thu, 23 Mar 2017 19:12:24 -0400 Subject: [PATCH] Allow toggle Jammer spawnpoint on/off Otherwise it stays there until the end of time .... --- .../epoch_player/EPOCH_server_makeSP.sqf | 21 +++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/Sources/epoch_server/compile/epoch_player/EPOCH_server_makeSP.sqf b/Sources/epoch_server/compile/epoch_player/EPOCH_server_makeSP.sqf index b125fc4e..a7b4a3a8 100644 --- a/Sources/epoch_server/compile/epoch_player/EPOCH_server_makeSP.sqf +++ b/Sources/epoch_server/compile/epoch_player/EPOCH_server_makeSP.sqf @@ -22,10 +22,23 @@ if (_player distance _jammer > 20) exitWith{}; // check if in group with owner if (alive _jammer) then { if ((_jammer getVariable["BUILD_OWNER", "-1"]) in [getPlayerUID _player, _player getVariable["GROUP", ""]]) then { - // set position of spawnpoint to players SERVER_VARS _server_vars = _player getVariable["SERVER_VARS", []]; - _server_vars set [0, getposATL _jammer]; // 0 = RESPAWN POS - _player setVariable ["SERVER_VARS", _server_vars]; - ["Spawnpoint set", 5] remoteExec ['Epoch_message',_player]; + if (_server_vars param [0,[]] 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]; + ["Spawnpoint set", 5] remoteExec ['Epoch_message',_player]; + } + else + { + // remove position of spawnpoint from players SERVER_VARS + _server_vars set [0, []]; // 0 = RESPAWN POS + _player setVariable ["SERVER_VARS", _server_vars]; + ["Spawnpoint removed", 5] remoteExec ['Epoch_message',_player]; + }; + } + else + { + ["This is not one of your Group's Jammers", 5] remoteExec ['Epoch_message',_player]; }; };