Merge pull request #725 from Ignatz-HeMan/patch-8

Make SpawnPoint on Player Pos + Bugfix
This commit is contained in:
vbawol 2017-04-03 09:54:07 -05:00 committed by GitHub
commit 3e44c3edd8
2 changed files with 5 additions and 2 deletions

View File

@ -120,7 +120,7 @@ if (!isNull _player) then {
_location = getMarkerPos "respawn_west";
_location set[2, 0];
if (_newLocation isEqualType [] && {(count _newLocation) == 3}) then {
_jammers = nearestObjects[_newLocation, ["PlotPole_EPOCH"], 1];
_jammers = nearestObjects[_newLocation, ["PlotPole_EPOCH"], 6];
if !(_jammers isEqualTo[]) then {
// get nearby object
_jammer = _jammers param [0,objNull];

View File

@ -25,10 +25,13 @@ if (alive _jammer) then {
_server_vars = _player getVariable["SERVER_VARS", []];
_currentPos = _server_vars param [0,[]];
// invalidate previous position
if (!(_currentPos isequaltype [])) then {
_currentPos = [];
};
if (!(_currentPos isEqualTo []) && {_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
_server_vars set [0, getposATL _player]; // 0 = RESPAWN POS
_player setVariable ["SERVER_VARS", _server_vars];
["Spawnpoint set", 5] remoteExec ['Epoch_message',_player];
}