mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2025-12-14 12:12:34 +03:00
Use shorter file names for groups
This commit is contained in:
42
SQF/dayz_code/groups/join.sqf
Normal file
42
SQF/dayz_code/groups/join.sqf
Normal file
@@ -0,0 +1,42 @@
|
||||
private ["_display","_inviter","_inviteText","_inviterUID","_oldGroup","_rejectButton","_uid"];
|
||||
|
||||
_display = findDisplay 80000;
|
||||
_rejectButton = _display displayCtrl 8;
|
||||
_inviteText = _display displayCtrl 9;
|
||||
{_x ctrlShow false} count [_inviteText,_rejectButton];
|
||||
|
||||
_inviterUID = "0";
|
||||
_uid = getPlayerUID player;
|
||||
|
||||
//Remove all invites to this player since they joined a group
|
||||
{
|
||||
if (_uid == _x select 1) then {
|
||||
_inviterUID = _x select 0; //Take most recent invite
|
||||
dayz_activeInvites set [_forEachIndex,"delete"];
|
||||
};
|
||||
} forEach dayz_activeInvites;
|
||||
dayz_activeInvites = dayz_activeInvites - ["delete"];
|
||||
|
||||
//Sync change to all remote machines (less data than sending whole array)
|
||||
PVDZ_groupInvite = [false,_uid];
|
||||
publicVariableServer "PVDZ_groupInvite";
|
||||
|
||||
_inviter = _inviterUID call dayz_getPlayer;
|
||||
|
||||
if (!isNull _inviter) then {
|
||||
_oldGroup = group player;
|
||||
[player] joinSilent (group _inviter);
|
||||
if (count (units _oldGroup) == 0) then {deleteGroup _oldGroup;};
|
||||
{
|
||||
_uid = getPlayerUID _x;
|
||||
if !(_uid in dayz_myGroup) then {
|
||||
dayz_myGroup set [count dayz_myGroup,_uid];
|
||||
};
|
||||
} count (units group player);
|
||||
|
||||
// Update saved group in DB
|
||||
PVDZ_Server_UpdateGroup = [1,player];
|
||||
publicVariableServer "PVDZ_Server_UpdateGroup";
|
||||
} else {
|
||||
systemChat localize "STR_EPOCH_INVITE_EXPIRED";
|
||||
};
|
||||
Reference in New Issue
Block a user