Files
DayZ-Epoch/SQF/dayz_code/actions/plotManagement/plotRemoveFriend.sqf
icomrade 96ddc8ff62 Add player to plot management by default
+ Some minor private array cleanup
2016-07-21 16:20:41 -04:00

23 lines
688 B
Plaintext

private ["_pos","_plots","_thePlot","_friends","_toRemove","_newList"];
_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];
PVDZ_veh_Save = [_thePlot,"gear"];
if (isServer) then {
PVDZ_veh_Save call server_updateObject;
} else {
publicVariableServer "PVDZ_veh_Save";
};
call PlotGetFriends;
call PlotNearbyHumans;