mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2025-12-14 04:02:37 +03:00
added plotManagement by DevZupa
This commit is contained in:
24
SQF/dayz_code/actions/plotManagement/plotAddFriend.sqf
Normal file
24
SQF/dayz_code/actions/plotManagement/plotAddFriend.sqf
Normal file
@@ -0,0 +1,24 @@
|
||||
private ["_pos","_plots","_thePlot","_inList"];
|
||||
_pos = _this select 0;
|
||||
if (_pos < 0) exitWith {};
|
||||
_toAdd = (Humans select _pos);
|
||||
_plots = nearestObjects [player, ["Plastic_Pole_EP1_DZ"],15];
|
||||
_thePlot = _plots select 0;
|
||||
_friends = _thePlot getVariable ["plotfriends",[]];
|
||||
_inList = false;
|
||||
{ if ((_x select 0) == (_toAdd select 0)) exitWith { _inList = true; }; } forEach _friends;
|
||||
if (_inList) exitWith { cutText ["Already on the list", "PLAIN DOWN"]; };
|
||||
if (count _friends == 6) exitWith { cutText ["Only 6 allowed","PLAIN DOWN"]; };
|
||||
_friends = _friends + [_toAdd ];
|
||||
_thePlot setVariable ["plotfriends", _friends, true];
|
||||
|
||||
if (isServer) then {
|
||||
PVDZ_veh_Save call server_updateObject;
|
||||
} else {
|
||||
PVDZ_veh_Save = [_thePlot,"gear"];
|
||||
publicVariableServer "PVDZ_veh_Save";
|
||||
};
|
||||
|
||||
|
||||
call PlotGetFriends;
|
||||
call PlotNearbyHumans;
|
||||
Reference in New Issue
Block a user