Plot / door management userlist sorting (#1747)

* Plot / door management userlist sorting

This correctly sorts the nearby humans list in both mods, I have this
running on my 1051 server with no issues, @ebaydayz please advise if
this is not right, I've tested it pretty well and it is indeed selecting
the right person/UID

* Door/plot management fixes

As per @ebaydayz
This commit is contained in:
oiad
2016-08-22 09:19:52 +12:00
committed by ebaydayz
parent 8ef349e2bb
commit 6bdc3956fb
7 changed files with 104 additions and 73 deletions

View File

@@ -1,14 +1,19 @@
private ["_closePeople","_friendUID","_friendName"];
private ["_closePeople","_friendUID","_friendName","_userList"];
disableSerialization;
_userList = (findDisplay 711195) displayCtrl 7101;
lbClear _userList;
_closePeople = if (DZE_doorManagementMustBeClose) then { player nearEntities ["CAManBase", 10] } else { playableUnits };
lbClear 7101;
_closePeople = player nearEntities ["CAManBase", 10];
if (!DZE_doorManagementMustBeClose) then {_closePeople = playableUnits};
Humans = [];
{
if (isPlayer _x) then {
_friendUID = [_x] call FNC_GetPlayerUID;
_friendName = name _x;
Humans set [count Humans, [_friendUID,toArray _friendName]];
lbAdd [7101, _friendName];
_friendName = name _x;
_userList lbAdd _friendName;
_userList lbSetData [(lbSize _userList) -1,_friendUID];
};
} forEach _closePeople;
lbSort _userList;