Files
DayZ-Epoch/SQF/dayz_code/actions/doorManagement/doorAddFriend.sqf
oiad be1fb51fe8 player_onPause fixes (#1796)
* player_onPause fixes

Properly displays the right message now for why you can't abort.

* Door Management/Plot Management isServer changes

Removes isServer, these are run on the client only so no need for this.

* dayz_server private tags

Fix a few missing private tags and remove a _forEachIndex tag.

Remove unused 1.0.5.1 dayz_server.pbo as it's no longer valid/needed
2016-11-12 20:56:58 -05:00

27 lines
968 B
Plaintext

private ["_inList","_toAdd","_friends","_friendUID","_friendName","_userList"];
disableSerialization;
_userList = (findDisplay 711195) displayCtrl 7101;
_friendUID = _this select 0;
_friendName = _userList lbText (lbCurSel _userList);
if (_friendUID == "") exitWith {};
_friends = TheDoor getVariable ["doorfriends",[]];
_toAdd = [_friendUID,toArray _friendName];
_inList = false;
{ if ((_x select 0) == (_toAdd select 0)) exitWith { _inList = true; }; } count _friends;
if (_inList) exitWith { systemChat localize "STR_EPOCH_PLOTMANAGEMENT_ADDFRIEND_ALREADYONTHELIST"; };
if ((count _friends) == DZE_doorManagementMaxFriends) exitWith { systemChat format[localize "STR_EPOCH_PLOTMANAGEMENT_ADDFRIEND_FRIENDLIMIT", DZE_doorManagementMaxFriends]; };
_friends set [(count _friends), _toAdd];
TheDoor setVariable ["doorfriends", _friends, true];
PVDZ_veh_Save = [TheDoor,"gear"];
publicVariableServer "PVDZ_veh_Save";
call DoorGetFriends;
call DoorNearbyHumans;