Temp groups 2
This commit is contained in:
vbawol 2017-08-30 22:47:21 -05:00 committed by GitHub
commit 290d948c91
4 changed files with 46 additions and 11 deletions

View File

@ -44,14 +44,14 @@ class Groups
{ {
condition = "true"; condition = "true";
action = "call EPOCH_Inventory_Group;"; action = "call EPOCH_Inventory_Group;";
icon = "perm_group_menu_ca.paa";//"x\addons\a3_epoch_code\Data\UI\buttons\perm_group_menu_ca.paa"; icon = "x\addons\a3_epoch_code\Data\UI\buttons\perm_group_menu_ca.paa";
tooltip = "Perm Group Menu"; tooltip = "Perm Group Menu";
}; };
class TempGroup class TempGroup
{ {
condition = "true"; condition = "true";
action = "call EPOCH_Inventory_TempGroup;"; action = "call EPOCH_Inventory_TempGroup;";
icon = "temp_group_menu_ca.paa";//"x\addons\a3_epoch_code\Data\UI\buttons\temp_group_menu_ca.paa"; icon = "x\addons\a3_epoch_code\Data\UI\buttons\temp_group_menu_ca.paa";
tooltip = "Temp Group Menu"; tooltip = "Temp Group Menu";
}; };
}; };

View File

@ -503,4 +503,41 @@ class VehMaintanance
tooltipcode = "format ['Upgrade to %1 - %2',(Ignatz_VehicleUpgradeArray select 4 select 2),(Ignatz_VehicleUpgradeArray select 4 select 3)]"; tooltipcode = "format ['Upgrade to %1 - %2',(Ignatz_VehicleUpgradeArray select 4 select 2),(Ignatz_VehicleUpgradeArray select 4 select 3)]";
}; };
}; };
};
//Groups
class Groups
{
condition = "dyna_isPlayer";
action = "";
icon = "x\addons\a3_epoch_code\Data\UI\buttons\group_menu_ca.paa";
tooltip = "Groups Menu";
class Group
{
condition = "dyna_isPlayer";
action = "call EPOCH_Inventory_Group;";
icon = "x\addons\a3_epoch_code\Data\UI\buttons\perm_group_menu_ca.paa";
tooltip = "Perm Group Menu";
};
class TempGroup
{
condition = "dyna_isPlayer";
action = "call EPOCH_Inventory_TempGroup;";
icon = "x\addons\a3_epoch_code\Data\UI\buttons\temp_group_menu_ca.paa";
tooltip = "Temp Group Menu";
};
};
class player_group_requests
{
condition = "dyna_isPlayer && !(Epoch_invited_GroupUIDs isEqualTo[])";
action = "call EPOCH_Inventory_iGroup;";
icon = "x\addons\a3_epoch_code\Data\UI\buttons\group_requests_ca.paa";
tooltip = "Group Requests";
};
class player_tempGroup_requests
{
condition = "dyna_isPlayer && !(Epoch_invited_tempGroupUIDs isEqualTo[])";
action = "call EPOCH_Inventory_itempGroup;";
icon = "x\addons\a3_epoch_code\Data\UI\buttons\group_requests_ca.paa";
tooltip = "Temp Group Requests";
}; };

View File

@ -22,7 +22,7 @@ if !([_player, _token] call EPOCH_server_getPToken) exitWith{};
_return = false; _return = false;
_groupID = getPlayerUID _player; _groupID = getPlayerUID _player;
if (_groupID != "") then { if (_groupID != "") then {
_allPlayers = allPlayers select {alive _x};
{ {
_group = grpNull; _group = grpNull;
_permGroup = _x getVariable["GROUP",""]; _permGroup = _x getVariable["GROUP",""];

View File

@ -43,10 +43,8 @@ if !(_contentArray isEqualTo []) then {
if ((_x getVariable ["TEMPGROUP",""]) != _groupID) then { if ((_x getVariable ["TEMPGROUP",""]) != _groupID) then {
_group = grpNull; _group = grpNull;
{ {
if ((_x getVariable["TEMPGROUP",""]) == _groupID) exitWith { _group = group _x;
_group = group _x; } forEach (_allPlayers select {(_x getVariable["TEMPGROUP", ""]) == _groupID});
};
} forEach _allPlayers;
if (isNull _group) then { if (isNull _group) then {
_group = createGroup [west, true]; _group = createGroup [west, true];
@ -56,6 +54,7 @@ if !(_contentArray isEqualTo []) then {
[_x] joinSilent _group; [_x] joinSilent _group;
}; };
} forEach (_allPlayers select {getPlayerUID _x == _selectedPlayerUID}); } forEach (_allPlayers select {getPlayerUID _x == _selectedPlayerUID});
// find player name from DB // find player name from DB
if (_selectedPlayerName == "Dead Player") then { if (_selectedPlayerName == "Dead Player") then {
@ -86,6 +85,7 @@ if !(_contentArray isEqualTo []) then {
//Remove //Remove
_found = false; _found = false;
_group = grpNull; _group = grpNull;
_permGroup = "";
{ {
_permGroup = _x getVariable["GROUP",""]; _permGroup = _x getVariable["GROUP",""];
_playerObj = _x; _playerObj = _x;
@ -93,10 +93,8 @@ if !(_contentArray isEqualTo []) then {
if !(_permGroup isEqualTo "")then if !(_permGroup isEqualTo "")then
{ {
{ {
if ((_x getVariable["GROUP",""]) == _groupID) exitWith { _group = group _x;
_group = group _x; } forEach (_allPlayers select {(_x getVariable["GROUP", ""]) == _permGroup});
};
} forEach _allPlayers;
}; };
_playerObj setVariable ["TEMPGROUP", nil]; _playerObj setVariable ["TEMPGROUP", nil];
if (isNull _group) then { if (isNull _group) then {