mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2025-12-14 04:02:37 +03:00
Auto promote group leader after changing clothes
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
//private ["_class","_position","_dir","_group","_oldUnit","_newUnit","_currentWpn","_muzzles","_currentAnim","_playerUID","_weapons","_magazines","_primweapon","_secweapon","_newBackpackType","_backpackWpn","_backpackMag","_backpackWpnTypes","_backpackWpnQtys","_countr","_backpackmagTypes","_backpackmagQtys","_display","_createSafePos","_wpnType","_ismelee","_rndx","_rndy"];
|
//private ["_class","_position","_dir","_group","_oldUnit","_newUnit","_currentWpn","_muzzles","_currentAnim","_playerUID","_weapons","_magazines","_primweapon","_secweapon","_newBackpackType","_backpackWpn","_backpackMag","_backpackWpnTypes","_backpackWpnQtys","_countr","_backpackmagTypes","_backpackmagQtys","_display","_createSafePos","_wpnType","_ismelee","_rndx","_rndy"];
|
||||||
private ["_weapons","_backpackWpn","_backpackMag","_currentWpn","_isWeapon","_backpackWpnTypes","_backpackWpnQtys","_countr","_class","_position","_dir","_currentAnim","_playerUID","_countMags","_magazines","_primweapon","_secweapon","_newBackpackType","_muzzles","_oldUnit","_group","_newUnit","_oldGroup","_idc","_display","_switchUnit"];
|
private ["_weapons","_backpackWpn","_backpackMag","_currentWpn","_isWeapon","_backpackWpnTypes","_backpackWpnQtys","_countr","_class","_position","_dir","_currentAnim","_playerUID","_countMags","_magazines","_primweapon","_secweapon","_newBackpackType","_muzzles","_oldUnit","_group","_newUnit","_oldGroup","_idc","_display","_switchUnit","_leader"];
|
||||||
_class = _this;
|
_class = _this;
|
||||||
if (gear_done) then {disableUserInput true;disableUserInput true;};
|
if (gear_done) then {disableUserInput true;disableUserInput true;};
|
||||||
disableSerialization;
|
disableSerialization;
|
||||||
@@ -65,6 +65,7 @@ _display closeDisplay 0;
|
|||||||
//BackUp Player Object
|
//BackUp Player Object
|
||||||
_oldUnit = player;
|
_oldUnit = player;
|
||||||
_oldGroup = group player;
|
_oldGroup = group player;
|
||||||
|
_leader = (player == leader _oldGroup);
|
||||||
|
|
||||||
/***********************************/
|
/***********************************/
|
||||||
//DONT USE player AFTER THIS POINT
|
//DONT USE player AFTER THIS POINT
|
||||||
@@ -126,6 +127,11 @@ _switchUnit = {
|
|||||||
if (!isNil "dayz_groupInit" && count (units _oldGroup) > 1) then {
|
if (!isNil "dayz_groupInit" && count (units _oldGroup) > 1) then {
|
||||||
[_newUnit] joinSilent _oldGroup;
|
[_newUnit] joinSilent _oldGroup;
|
||||||
if (count (units _group) == 0) then {deleteGroup _group;};
|
if (count (units _group) == 0) then {deleteGroup _group;};
|
||||||
|
if (_leader) then {
|
||||||
|
//Request new leader promote player back to leader (group is local to leader)
|
||||||
|
PVDZ_Server_UpdateGroup = [-1,player];
|
||||||
|
publicVariableServer "PVDZ_Server_UpdateGroup";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
if (count (units _oldGroup) == 0) then {deleteGroup _oldGroup;};
|
if (count (units _oldGroup) == 0) then {deleteGroup _oldGroup;};
|
||||||
if (_currentWpn != "") then {_newUnit selectWeapon _currentWpn;};
|
if (_currentWpn != "") then {_newUnit selectWeapon _currentWpn;};
|
||||||
|
|||||||
@@ -3,6 +3,10 @@ private ["_add","_inviter","_recipient","_uid","_unit"];
|
|||||||
_add = _this select 0;
|
_add = _this select 0;
|
||||||
_uid = _this select 1;
|
_uid = _this select 1;
|
||||||
|
|
||||||
|
if (typeName _add == "OBJECT") exitWith {
|
||||||
|
(group player) selectLeader _add;
|
||||||
|
};
|
||||||
|
|
||||||
// Update active invites on all machines with the change
|
// Update active invites on all machines with the change
|
||||||
if (_add) then {
|
if (_add) then {
|
||||||
_inviter = _uid select 0;
|
_inviter = _uid select 0;
|
||||||
|
|||||||
@@ -10,6 +10,12 @@ if (_event < 3) then {
|
|||||||
uiSleep 1;
|
uiSleep 1;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if (_event == -1) exitWith {
|
||||||
|
//Promote _player
|
||||||
|
PVDZ_groupInvite = [_player,0];
|
||||||
|
(owner (leader group _player)) publicVariableClient "PVDZ_groupInvite";
|
||||||
|
};
|
||||||
|
|
||||||
_groupUIDs = [];
|
_groupUIDs = [];
|
||||||
{
|
{
|
||||||
if (alive _x && isPlayer _x) then {
|
if (alive _x && isPlayer _x) then {
|
||||||
|
|||||||
Reference in New Issue
Block a user