Rejoin group after dropping and picking back up radio

This commit is contained in:
ebayShopper
2017-04-17 11:49:54 -04:00
parent 3b12dc09d3
commit 75a12ad953
2 changed files with 15 additions and 1 deletions

View File

@@ -1,10 +1,13 @@
private ["_bodyCount","_count","_group","_hasGPS","_index","_inGroup","_marker","_markBody","_markGroup","_markSelf","_name","_pos","_self","_vehicle"];
private ["_bodyCount","_count","_group","_hasGPS","_index","_inGroup","_lastGroup","_marker","_markBody","_markGroup","_markSelf","_name","_oldGroup","_pos","_self","_vehicle"];
_lastGroup = grpNull;
while {true} do {
_group = player call dayz_filterGroup;
_inGroup = count _group > 1;
if (dayz_requireRadio && {_inGroup} && {!("ItemRadio" in items player)}) then {
_lastGroup = group player;
[player] joinSilent grpNull;
if (!isNull findDisplay 80000) then {findDisplay 80000 closeDisplay 2;};
terminate dayz_groupTags;
@@ -15,6 +18,16 @@ while {true} do {
dayz_groupTags = execVM "\z\addons\dayz_code\groups\groupTags.sqf";
};
if (!isNull _lastGroup && {"ItemRadio" in items player}) then {
_oldGroup = group player;
[player] joinSilent _lastGroup;
if (count (units _oldGroup) == 0) then {deleteGroup _oldGroup;};
format[localize "STR_EPOCH_REJOINED_GROUP",name leader _lastGroup] call dayz_rollingMessages;
PVDZ_Server_UpdateGroup = [1,player];
publicVariableServer "PVDZ_Server_UpdateGroup";
_lastGroup = grpNull;
};
if (visibleMap or !isNull (uiNamespace getVariable["BIS_RscMiniMap",displayNull])) then {
_hasGPS = "ItemGPS" in items player;
_markBody = (dayz_markBody == 1 or (dayz_markBody == 2 && _hasGPS));