mirror of
https://github.com/EpochModTeam/Epoch.git
synced 2024-08-30 18:22:13 +00:00
Merge pull request #617 from Ignatz-HeMan/patch-3
EPOCH_upgradeBUILD.sqf + EPOCH_Group_BtnInvite.sqf
This commit is contained in:
@ -83,6 +83,13 @@ if (_object isKindOf "Constructions_static_F") then {
|
|||||||
|
|
||||||
// take upgrade item from player here
|
// take upgrade item from player here
|
||||||
_config = 'CfgBaseBuilding' call EPOCH_returnConfig;
|
_config = 'CfgBaseBuilding' call EPOCH_returnConfig;
|
||||||
|
_config2 = 'CfgEpochClient' call EPOCH_returnConfig;
|
||||||
|
_buildingJammerRange = getNumber(_config2 >> "buildingJammerRange");
|
||||||
|
_maxdoors = getNumber(_config2 >> "maxdoors");
|
||||||
|
_maxgates = getNumber(_config2 >> "maxgates");
|
||||||
|
if (_buildingJammerRange == 0) then {_buildingJammerRange = 150};
|
||||||
|
if (_maxdoors == 0) then {_maxdoors = 12};
|
||||||
|
if (_maxgates == 0) then {_maxgates = 10};
|
||||||
|
|
||||||
_upgrades = getArray(_config >> (typeOf _object) >> "upgradeBuilding");
|
_upgrades = getArray(_config >> (typeOf _object) >> "upgradeBuilding");
|
||||||
if !(_upgrades isEqualTo []) then {
|
if !(_upgrades isEqualTo []) then {
|
||||||
@ -109,6 +116,26 @@ if (_object isKindOf "Constructions_static_F") then {
|
|||||||
_canUpgradePartCount = _canUpgradePartCount + _req;
|
_canUpgradePartCount = _canUpgradePartCount + _req;
|
||||||
} forEach _upgradeParts;
|
} forEach _upgradeParts;
|
||||||
|
|
||||||
|
_doors = ["WoodLargeWallDoorL_EPOCH","WoodWall4_EPOCH"];
|
||||||
|
_gates = ["CinderWallGarage_EPOCH"];
|
||||||
|
if (_canUpgrade) then {
|
||||||
|
_upgradeto = _upgrade select 0;
|
||||||
|
if (_upgradeto in _doors) then {
|
||||||
|
_countdoors = count (nearestobjects [_nearestJammer,_doors,_buildingJammerRange]);
|
||||||
|
if (_countdoors >= _maxdoors) then {
|
||||||
|
_canUpgrade = false;
|
||||||
|
_missingParts = _missingParts + format["Can not upgrade to locked Door! Max %1 allowed per Base!", _maxdoors];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
if (_upgradeto in _gates) then {
|
||||||
|
_countgates = count (nearestobjects [_nearestJammer,_gates,_buildingJammerRange]);
|
||||||
|
if (_countgates >= _maxgates) then {
|
||||||
|
_canUpgrade = false;
|
||||||
|
_missingParts = _missingParts + format["Can not upgrade to Gate! Max %1 allowed per Base!", _maxgates];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
_removedPartCount = 0;
|
_removedPartCount = 0;
|
||||||
if (_canUpgrade) then {
|
if (_canUpgrade) then {
|
||||||
{
|
{
|
||||||
|
@ -25,7 +25,7 @@ if (_playerUID == Epoch_my_GroupUID || {_x select 0 == _playerUID}count (Epoch_m
|
|||||||
_InvitePlayerCombo = (findDisplay -1300) displayCtrl 41;
|
_InvitePlayerCombo = (findDisplay -1300) displayCtrl 41;
|
||||||
_playerUID = _InvitePlayerCombo lbData (lbCurSel _InvitePlayerCombo);
|
_playerUID = _InvitePlayerCombo lbData (lbCurSel _InvitePlayerCombo);
|
||||||
_playerName = _InvitePlayerCombo lbText (lbCurSel _InvitePlayerCombo);
|
_playerName = _InvitePlayerCombo lbText (lbCurSel _InvitePlayerCombo);
|
||||||
if (_playerUID != "" && _playerName != "") then {
|
if (_playerUID != "" && _playerName != "" && ({_playerUID in _x} count (Epoch_my_Group select 3) == 0) && ({_playerUID in _x} count (Epoch_my_Group select 4) == 0) && !(_playerUID == Epoch_my_GroupUID)) then {
|
||||||
_txt = format["Do you want to add %1 to your Group?",_playerName];
|
_txt = format["Do you want to add %1 to your Group?",_playerName];
|
||||||
[_playerUID,_txt] spawn {
|
[_playerUID,_txt] spawn {
|
||||||
_ret = [_this select 1,"Epoch Group Menu",true,true] call BIS_fnc_GUImessage;
|
_ret = [_this select 1,"Epoch Group Menu",true,true] call BIS_fnc_GUImessage;
|
||||||
|
Reference in New Issue
Block a user