diff --git a/SQF/dayz_code/groups/disband.sqf b/SQF/dayz_code/groups/disband.sqf index efba94a2c..db6c53cfb 100644 --- a/SQF/dayz_code/groups/disband.sqf +++ b/SQF/dayz_code/groups/disband.sqf @@ -13,5 +13,4 @@ dayz_groupDisbandThread = _group spawn { {[_x] joinSilent grpNull} count (units _this); deleteGroup _this; - dayz_myGroup = []; }; \ No newline at end of file diff --git a/SQF/dayz_code/groups/groupMarkers.sqf b/SQF/dayz_code/groups/groupMarkers.sqf index 3cf550a5a..1d411fd0d 100644 --- a/SQF/dayz_code/groups/groupMarkers.sqf +++ b/SQF/dayz_code/groups/groupMarkers.sqf @@ -1,5 +1,5 @@ // Two second loop -private ["_count","_found","_group","_hasGPS","_index","_marker","_markBody","_markGroup","_markSelf","_pos","_self","_uid","_vehicle"]; +private ["_count","_found","_group","_hasGPS","_index","_marker","_markBody","_markGroup","_markSelf","_pos","_self","_vehicle"]; _group = player call dayz_filterGroup; @@ -10,14 +10,6 @@ if (dayz_requireRadio && {count _group > 1} && {!("ItemRadio" in items player)}) localize "STR_EPOCH_RADIO_CONTACT_LOST" call dayz_rollingMessages; }; -{ - _uid = getPlayerUID _x; - if (!(_uid in dayz_myGroup) && _x != player) then { - dayz_myGroup set [count dayz_myGroup,_uid]; - systemChat format [localize "STR_EPOCH_PLAYER_JOINED",name _x]; - }; -} count _group; - if (visibleMap or !isNull findDisplay 88890) then { _hasGPS = "ItemGPS" in items player; _markBody = (dayz_markBody == 1 or (dayz_markBody == 2 && _hasGPS)); diff --git a/SQF/dayz_code/groups/handleInvite.sqf b/SQF/dayz_code/groups/handleInvite.sqf index 7e4a9c481..d6a7d5c4d 100644 --- a/SQF/dayz_code/groups/handleInvite.sqf +++ b/SQF/dayz_code/groups/handleInvite.sqf @@ -3,8 +3,14 @@ private ["_add","_inviter","_recipient","_uid","_unit"]; _add = _this select 0; _uid = _this select 1; -if (typeName _add == "OBJECT") exitWith { - (group player) selectLeader _add; +if (typeName _add == "SCALAR") exitWith { + switch _add do { + case -1: { (group player) selectLeader _uid; }; //Promote + case 1: { systemChat format[localize "STR_EPOCH_PLAYER_JOINED",_uid]; }; + case 2: { systemChat format[localize "STR_EPOCH_PLAYER_KICKED",name (_uid call dayz_getPlayer)]; }; + case 3: { systemChat format[localize "STR_EPOCH_PLAYER_LEFT",_uid]; }; + case 4: { localize "STR_EPOCH_GROUP_DISBANDED" call dayz_rollingMessages; }; + }; }; // Update active invites on all machines with the change diff --git a/SQF/dayz_code/groups/init.sqf b/SQF/dayz_code/groups/init.sqf index 8ea88a0c4..c109028e5 100644 --- a/SQF/dayz_code/groups/init.sqf +++ b/SQF/dayz_code/groups/init.sqf @@ -13,7 +13,7 @@ if (count dayz_myGroup > 1 && {!dayz_requireRadio or {dayz_requireRadio && "Item _oldGroup = group player; [player] joinSilent _x; if (count (units _oldGroup) == 0) then {deleteGroup _oldGroup;}; - systemChat format [localize "STR_EPOCH_REJOINED_GROUP",name _leader]; + format[localize "STR_EPOCH_REJOINED_GROUP",name _leader] call dayz_rollingMessages; // Update saved group in DB PVDZ_Server_UpdateGroup = [1,player]; diff --git a/SQF/dayz_code/groups/join.sqf b/SQF/dayz_code/groups/join.sqf index 35d994397..c173bf916 100644 --- a/SQF/dayz_code/groups/join.sqf +++ b/SQF/dayz_code/groups/join.sqf @@ -27,12 +27,6 @@ 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]; diff --git a/SQF/dayz_code/groups/kick.sqf b/SQF/dayz_code/groups/kick.sqf index 9f39e1dc7..5874ff2c5 100644 --- a/SQF/dayz_code/groups/kick.sqf +++ b/SQF/dayz_code/groups/kick.sqf @@ -8,7 +8,6 @@ _target = _targetUID call dayz_getPlayer; if (isNull _target or _target == player or player != leader group player) exitWith {}; [_target] joinSilent grpNull; -dayz_myGroup = dayz_myGroup - [_targetUID]; PVDZ_Server_UpdateGroup = [2,player,_targetUID]; publicVariableServer "PVDZ_Server_UpdateGroup"; diff --git a/SQF/dayz_code/groups/leave.sqf b/SQF/dayz_code/groups/leave.sqf index b652a2a1c..8f2a07d3d 100644 --- a/SQF/dayz_code/groups/leave.sqf +++ b/SQF/dayz_code/groups/leave.sqf @@ -11,5 +11,4 @@ dayz_groupLeaveThread = [] spawn { //Wait for response from server to confirm group finished updating in DB waitUntil {!isNil "dayz_groupLeft"}; [player] joinSilent grpNull; - dayz_myGroup = []; }; \ No newline at end of file diff --git a/SQF/dayz_code/groups/server_updateGroup.sqf b/SQF/dayz_code/groups/server_updateGroup.sqf index 33fa85a9d..ffeb2d04a 100644 --- a/SQF/dayz_code/groups/server_updateGroup.sqf +++ b/SQF/dayz_code/groups/server_updateGroup.sqf @@ -1,7 +1,8 @@ -private ["_event","_groupUIDs","_newGroup","_player","_playerUID","_save"]; +private ["_event","_groupUIDs","_name","_newGroup","_player","_playerUID","_save","_unit"]; _event = _this select 0; _player = _this select 1; +_name = if (alive _player) then {name _player} else {"unknown"}; _playerUID = getPlayerUID _player; if (_event < 3) then { @@ -11,7 +12,7 @@ if (_event < 3) then { if (_event == -1) exitWith { //Promote _player - PVDZ_groupInvite = [_player,0]; + PVDZ_groupInvite = [-1,_player]; (owner (leader group _player)) publicVariableClient "PVDZ_groupInvite"; }; @@ -28,7 +29,8 @@ _newGroup = switch _event do { case 1: {_groupUIDs}; //Kick (target was already kicked from group) case 2: { - format["CHILD:204:%1:%2:%3:",(_this select 2),dayZ_instance,[]] call server_hiveWrite; + _name = _this select 2; //Kicked player's UID + format["CHILD:204:%1:%2:%3:",_name,dayZ_instance,[]] call server_hiveWrite; _groupUIDs }; //Leave @@ -39,14 +41,24 @@ _newGroup = switch _event do { }; //Disband case 4: { + _name = 0; //Not needed dayz_groupDisbanded = true; (owner _player) publicVariableClient "dayz_groupDisbanded"; [] }; }; -// Update all group members' saved group in DB +//Update all group members' saved group in DB { _save = if (_event == 3 && _x == _playerUID) then {[]} else {_newGroup}; format["CHILD:204:%1:%2:%3:",_x,dayZ_instance,_save] call server_hiveWrite; -} count _groupUIDs; \ No newline at end of file +} count _groupUIDs; + +//Notify group members of the change +PVDZ_groupInvite = [_event,_name]; +{ + _unit = getPlayerUID _x; + if (_unit in _groupUIDs && {_unit != _playerUID}) then { + owner _x publicVariableClient "PVDZ_groupInvite"; + }; +} count allUnits; \ No newline at end of file diff --git a/SQF/dayz_code/stringtable.xml b/SQF/dayz_code/stringtable.xml index 6ec706cfc..9bbac52fb 100644 --- a/SQF/dayz_code/stringtable.xml +++ b/SQF/dayz_code/stringtable.xml @@ -16317,6 +16317,12 @@ You invited %1 to join the group. Du hast %1 eingeladen der Gruppe beizutreten. + + %1 was kicked from the group. + + + %1 left the group. + %1 joined the group. %1 ist der Gruppe beigetreten. @@ -16357,6 +16363,9 @@ распускать Auflösen + + The group disbanded + Leave Оставлять