Files
DayZ-Epoch/SQF/dayz_code/actions/plotManagement/plotRemoveFriend.sqf
ebaydayz edb64c4e05 Fix plot manage array add errors from 1e65f7a
@icomrade - when you use set to add an element to an array you do not
need to wrap it in brackets [ ] like you do with +.

This was making it a nested array which was not intended in the
original.
2016-05-17 19:30:21 -04:00

25 lines
669 B
Plaintext

private ["_list","_plots","_thePlot","_friends"];
_pos = _this select 0;
if (_pos < 0) exitWith {};
_plots = nearestObjects [[player] call FNC_getPos, ["Plastic_Pole_EP1_DZ"],15];
_thePlot = _plots select 0;
_friends = _thePlot getVariable ["plotfriends", []];
_toRemove = (_friends select _pos);
_newList = [];
{
if(_x select 0 != _toRemove select 0)then{
_newList set [(count _newList), _x];
};
} count _friends;
_thePlot setVariable ["plotfriends", _newList, true];
if (isServer) then {
PVDZ_veh_Save call server_updateObject;
} else {
PVDZ_veh_Save = [_thePlot,"gear"];
publicVariableServer "PVDZ_veh_Save";
};
call PlotGetFriends;
call PlotNearbyHumans;