diff --git a/SQF/dayz_code/actions/maintain_area.sqf b/SQF/dayz_code/actions/maintain_area.sqf index 6343d6c1c..c1eb86c24 100644 --- a/SQF/dayz_code/actions/maintain_area.sqf +++ b/SQF/dayz_code/actions/maintain_area.sqf @@ -1,5 +1,5 @@ -//Code developed by Axe Cop - Massiv improvments and performance tunes by Skaronator -private ["_missing","_missingQty","_proceed","_itemIn","_countIn","_qty","_num_removed","_uniqueID","_removed","_removed_total","_tobe_removed_total","_obj","_objectID","_objectUID","_classname","_location","_dir","_objectCharacterID","_object","_temp_removed_array","_textMissing","_target","_objectClasses","_range","_objects","_requirements","_count","_cost","_itemText","_option"]; +//Code developed by Axe Cop - Massive improvments and performance tunes by Skaronator +private ["_objectID","_objectUID","_target","_objectClasses","_range","_objects","_requirements","_count","_option","_objects_filtered","_ctrl","_itemText"]; if (DZE_ActionInProgress) exitWith {localize "STR_EPOCH_ACTIONS_2" call dayz_rollingMessages;}; DZE_ActionInProgress = true; @@ -9,7 +9,7 @@ s_player_maintain_area = 1; player removeAction s_player_maintain_area_preview; s_player_maintain_area_preview = 1; -_target = (_this select 3) select 1; // Plastic_Pole_EP1_DZ +_target = nearestObject [[player] call FNC_getPos,"Plastic_Pole_EP1_DZ"]; _objectClasses = DZE_maintainClasses; _range = DZE_maintainRange; // set the max range for the maintain area @@ -21,7 +21,7 @@ _count = 0; { if (damage _x >= DZE_DamageBeforeMaint) then { _objectUID = _x getVariable ["ObjectUID","0"]; - _objectID = _x getVariable ["ObjectID","0"]; + _objectID = _x getVariable ["ObjectID","0"]; _objects_filtered set [count _objects_filtered, [_x, _objectID, _objectUID]]; _count = _count + 1; }; @@ -37,6 +37,8 @@ if (_count == 0) exitWith { }; _requirements = []; +_option = _this select 0; + switch true do { case (_count <= 10): {_requirements = [["ItemGoldBar10oz",1]]}; case (_count <= 20): {_requirements = [["ItemGoldBar10oz",2]]}; @@ -54,74 +56,31 @@ switch true do { case (_count > 625): {_requirements = [["ItemBriefcase100oz",9]]}; }; +_itemText = getText(configFile >> "CfgMagazines" >> (_requirements select 0) select 0 >> "displayName"); +if ("ItemBriefcase100oz" == (_requirements select 0) select 0 && (_requirements select 0) select 1 > 1) then { + _itemText = _itemText + "s"; +}; - -_option = (_this select 3) select 0; switch _option do { case "maintain": { - - _missing = ""; - _missingQty = 0; - _proceed = true; - { - _itemIn = _x select 0; - _countIn = _x select 1; - _qty = { (_x == _itemIn) || (configName(inheritsFrom(configFile >> "cfgMagazines" >> _x)) == _itemIn) } count magazines player; - if (_qty < _countIn) exitWith { _missing = _itemIn; _missingQty = (_countIn - _qty); _proceed = false; }; - } forEach _requirements; - - if (_proceed) then { + if ([[[(_requirements select 0) select 0, (_requirements select 0) select 1]],0] call epoch_returnChange) then { player playActionNow "Medic"; [player,_range,true,(getPosATL player)] spawn player_alertZombies; - _temp_removed_array = []; - _removed_total = 0; - _tobe_removed_total = 0; + PVDZE_maintainArea = [player,1,_objects]; + publicVariableServer "PVDZE_maintainArea"; - { - _removed = 0; - _itemIn = _x select 0; - _countIn = _x select 1; - _tobe_removed_total = _tobe_removed_total + _countIn; - - { - if ((_removed < _countIn) && ((_x == _itemIn) || configName(inheritsFrom(configFile >> "cfgMagazines" >> _x)) == _itemIn)) then { - _num_removed = ([player,_x] call BIS_fnc_invRemove); - _removed = _removed + _num_removed; - _removed_total = _removed_total + _num_removed; - if (_num_removed >= 1) then { - _temp_removed_array set [count _temp_removed_array,_x]; - }; - }; - } forEach magazines player; - } forEach _requirements; - - // all required items removed from player gear - if (_tobe_removed_total == _removed_total) then { - format[localize "STR_EPOCH_ACTIONS_4",_count] call dayz_rollingMessages; - PVDZE_maintainArea = [player,1, _objects]; - publicVariableServer "PVDZE_maintainArea"; - } else { - {player addMagazine _x;} count _temp_removed_array; - format[localize "STR_EPOCH_PLAYER_145",_removed_total,_tobe_removed_total] call dayz_rollingMessages; - }; + systemChat format[localize "STR_EPOCH_ACTIONS_4", _count]; + format[localize "STR_EPOCH_PLOTMANAGEMENT_PRICE_MAINTAINED_SUCCESS", (_requirements select 0) select 1, _itemText] call dayz_rollingMessages; + format[localize "STR_EPOCH_PLOTMANAGEMENT_OBJECTS_MAINTAINED_SUCCESS", _count] call dayz_rollingMessages; } else { - _textMissing = getText(configFile >> "CfgMagazines" >> _missing >> "displayName"); - format[localize "STR_EPOCH_ACTIONS_6",_missingQty,_textMissing] call dayz_rollingMessages; + format[localize "STR_EPOCH_PLOTMANAGEMENT_MONEY_NEEDED_FAILED", (_requirements select 0) select 1, _itemText] call dayz_rollingMessages; + format[localize "STR_EPOCH_PLOTMANAGEMENT_OBJECTS_MAINTAINED_FAILED", _count] call dayz_rollingMessages; }; }; case "preview": { - _cost = ""; - { - _itemIn = _x select 0; - _countIn = _x select 1; - _itemText = getText(configFile >> "CfgMagazines" >> _itemIn >> "displayName"); - if (_cost != "") then { - _cost = _cost + " and "; - }; - _cost = _cost + (str(_countIn) + " of " + _itemText); - } count _requirements; - format[localize "STR_EPOCH_ACTIONS_7",_count,_cost] call dayz_rollingMessages; + format[localize "STR_EPOCH_PLOTMANAGEMENT_MAINTAIN_PRICE", (_requirements select 0) select 1, _itemText] call dayz_rollingMessages; + format[localize "STR_EPOCH_PLOTMANAGEMENT_MAINTAIN_OBJECTS", _count] call dayz_rollingMessages; }; }; diff --git a/SQF/dayz_code/actions/plotManagement/initPlotManagement.sqf b/SQF/dayz_code/actions/plotManagement/initPlotManagement.sqf index f650ab691..af6f90f61 100644 --- a/SQF/dayz_code/actions/plotManagement/initPlotManagement.sqf +++ b/SQF/dayz_code/actions/plotManagement/initPlotManagement.sqf @@ -2,4 +2,4 @@ createdialog "PlotManagement"; call PlotNearbyHumans; call PlotGetFriends; ["preview"] call MaintainPlot; -call PlotObjects; +call PlotObjects; \ No newline at end of file diff --git a/SQF/dayz_code/actions/plotManagement/maintain_area.sqf b/SQF/dayz_code/actions/plotManagement/maintain_area.sqf index c69bf035e..3f56ec428 100644 --- a/SQF/dayz_code/actions/plotManagement/maintain_area.sqf +++ b/SQF/dayz_code/actions/plotManagement/maintain_area.sqf @@ -1,4 +1,4 @@ -private ["_missing","_missingQty","_proceed","_itemIn","_countIn","_qty","_num_removed","_uniqueID","_removed","_removed_total","_tobe_removed_total","_obj","_objectID","_objectUID","_classname","_location","_dir","_objectCharacterID","_object","_temp_removed_array","_textMissing","_target","_objectClasses","_range","_objects","_requirements","_count","_cost","_itemText","_option"]; +private ["_objectID","_objectUID","_target","_objectClasses","_range","_objects","_requirements","_count","_option","_objects_filtered","_ctrl","_itemText"]; disableSerialization; if (DZE_ActionInProgress) exitWith {localize "STR_EPOCH_ACTIONS_2" call dayz_rollingMessages;}; @@ -12,7 +12,7 @@ s_player_maintain_area_preview = 1; _target = nearestObject [[player] call FNC_getPos,"Plastic_Pole_EP1_DZ"]; _objectClasses = DZE_maintainClasses; -_range = DZE_PlotPole select 0; +_range = DZE_maintainRange; // set the max range for the maintain area _objects = nearestObjects [_target, _objectClasses, _range]; _objects_filtered = []; @@ -20,7 +20,7 @@ _count = 0; { if (damage _x >= DZE_DamageBeforeMaint) then { _objectUID = _x getVariable ["ObjectUID","0"]; - _objectID = _x getVariable ["ObjectID","0"]; + _objectID = _x getVariable ["ObjectID","0"]; _objects_filtered set [count _objects_filtered, [_x, _objectID, _objectUID]]; _count = _count + 1; }; @@ -30,17 +30,17 @@ _objects = _objects_filtered; // TODO dynamic requirements based on used building parts? if (_count == 0) exitWith { _ctrl = ((uiNamespace getVariable "PlotManagement") displayCtrl 7012); - _result = format[localize "STR_EPOCH_PLOTMANAGEMENT_MAINTAIN_OBJECTS", _count]; - _ctrl ctrlSetText _result; + _ctrl ctrlSetText format[localize "STR_EPOCH_PLOTMANAGEMENT_MAINTAIN_OBJECTS", _count]; _ctrl = ((uiNamespace getVariable "PlotManagement") displayCtrl 7013); - _result = format[localize "STR_EPOCH_PLOTMANAGEMENT_NO_MONEY_NEEDED", " "]; - _ctrl ctrlSetText _result; + _ctrl ctrlSetText format[localize "STR_EPOCH_PLOTMANAGEMENT_NO_MONEY_NEEDED", " "]; DZE_ActionInProgress = false; s_player_maintain_area = -1; s_player_maintain_area_preview = -1; }; _requirements = []; +_option = _this select 0; + switch true do { case (_count <= 10): {_requirements = [["ItemGoldBar10oz",1]]}; case (_count <= 20): {_requirements = [["ItemGoldBar10oz",2]]}; @@ -58,91 +58,37 @@ switch true do { case (_count > 625): {_requirements = [["ItemBriefcase100oz",9]]}; }; +_itemText = getText(configFile >> "CfgMagazines" >> (_requirements select 0) select 0 >> "displayName"); +if ("ItemBriefcase100oz" == (_requirements select 0) select 0 && (_requirements select 0) select 1 > 1) then { + _itemText = _itemText + "s"; +}; - -_option = _this select 0; switch _option do { - case "maintain": { - _missing = ""; - _missingQty = 0; - _proceed = true; - { - _itemIn = _x select 0; - _countIn = _x select 1; - _qty = { (_x == _itemIn) || (configName(inheritsFrom(configFile >> "cfgMagazines" >> _x)) == _itemIn) } count magazines player; - if (_qty < _countIn) exitWith { _missing = _itemIn; _missingQty = (_countIn - _qty); _proceed = false; }; - } forEach _requirements; - - if (_proceed) then { + case "maintain": { + if ([[[(_requirements select 0) select 0, (_requirements select 0) select 1]],0] call epoch_returnChange) then { player playActionNow "Medic"; [player,_range,true,(getPosATL player)] spawn player_alertZombies; - _temp_removed_array = []; - _removed_total = 0; - _tobe_removed_total = 0; + PVDZE_maintainArea = [player,1,_objects]; + publicVariableServer "PVDZE_maintainArea"; - { - _removed = 0; - _itemIn = _x select 0; - _countIn = _x select 1; - _tobe_removed_total = _tobe_removed_total + _countIn; - - { - if ((_removed < _countIn) && ((_x == _itemIn) || configName(inheritsFrom(configFile >> "cfgMagazines" >> _x)) == _itemIn)) then { - _num_removed = ([player,_x] call BIS_fnc_invRemove); - _removed = _removed + _num_removed; - _removed_total = _removed_total + _num_removed; - if (_num_removed >= 1) then { - _temp_removed_array set [count _temp_removed_array,_x]; - }; - }; - } forEach magazines player; - } forEach _requirements; - - // all required items removed from player gear - if (_tobe_removed_total == _removed_total) then { - format[localize "STR_EPOCH_ACTIONS_4", _count] call dayz_rollingMessages; - PVDZE_maintainArea = [player,1,_objects]; - publicVariableServer "PVDZE_maintainArea"; - _ctrl = ((uiNamespace getVariable "PlotManagement") displayCtrl 7012); - _result = format[localize "STR_EPOCH_PLOTMANAGEMENT_OBJECTS_MAINTAINED_SUCCESS", _count]; - _ctrl ctrlSetText _result; - _ctrl = ((uiNamespace getVariable "PlotManagement") displayCtrl 7013); - _result = format[localize "STR_EPOCH_PLOTMANAGEMENT_PRICE_MAINTAINED_SUCCESS", (_requirements select 0) select 1, (_requirements select 0) select 0]; - _ctrl ctrlSetText _result; - } else { - {player addMagazine _x;} count _temp_removed_array; - format[localize "STR_EPOCH_ACTIONS_5",_removed_total,_tobe_removed_total] call dayz_rollingMessages; - }; - } else { - _textMissing = getText(configFile >> "CfgMagazines" >> _missing >> "displayName"); + systemChat format[localize "STR_EPOCH_ACTIONS_4", _count]; _ctrl = ((uiNamespace getVariable "PlotManagement") displayCtrl 7012); - _result = format[localize "STR_EPOCH_PLOTMANAGEMENT_OBJECTS_MAINTAINED_FAILED", _count]; - _ctrl ctrlSetText _result; + _ctrl ctrlSetText format[localize "STR_EPOCH_PLOTMANAGEMENT_OBJECTS_MAINTAINED_SUCCESS", _count]; _ctrl = ((uiNamespace getVariable "PlotManagement") displayCtrl 7013); - _result = format[localize "STR_EPOCH_PLOTMANAGEMENT_MONEY_NEEDED_FAILED", (_requirements select 0) select 1, (_requirements select 0) select 0]; - _ctrl ctrlSetText _result; - format[localize "STR_EPOCH_ACTIONS_6", _missingQty, _textMissing] call dayz_rollingMessages; + _ctrl ctrlSetText format[localize "STR_EPOCH_PLOTMANAGEMENT_PRICE_MAINTAINED_SUCCESS", (_requirements select 0) select 1, _itemText]; + } else { + _ctrl = ((uiNamespace getVariable "PlotManagement") displayCtrl 7012); + _ctrl ctrlSetText format[localize "STR_EPOCH_PLOTMANAGEMENT_OBJECTS_MAINTAINED_FAILED", _count]; + _ctrl = ((uiNamespace getVariable "PlotManagement") displayCtrl 7013); + _ctrl ctrlSetText format[localize "STR_EPOCH_PLOTMANAGEMENT_MONEY_NEEDED_FAILED", (_requirements select 0) select 1, _itemText]; }; }; case "preview": { - _cost = ""; - { - _itemIn = _x select 0; - _countIn = _x select 1; - _itemText = getText(configFile >> "CfgMagazines" >> _itemIn >> "displayName"); - if (_cost != "") then { - _cost = _cost + " and "; //TODO: localize? - }; - _cost = _cost + (str(_countIn) + " of " + _itemText); //TODO: localize? - } count _requirements; - format[localize "STR_EPOCH_ACTIONS_7", _count, _cost] call dayz_rollingMessages; _ctrl = ((uiNamespace getVariable "PlotManagement") displayCtrl 7012); - _result = format[localize "STR_EPOCH_PLOTMANAGEMENT_MAINTAIN_OBJECTS", _count]; - _ctrl ctrlSetText _result; + _ctrl ctrlSetText format[localize "STR_EPOCH_PLOTMANAGEMENT_MAINTAIN_OBJECTS", _count]; _ctrl = ((uiNamespace getVariable "PlotManagement") displayCtrl 7013); - _result = format[localize "STR_EPOCH_PLOTMANAGEMENT_MAINTAIN_PRICE", (_requirements select 0) select 1, (_requirements select 0) select 0]; - _ctrl ctrlSetText _result; + _ctrl ctrlSetText format[localize "STR_EPOCH_PLOTMANAGEMENT_MAINTAIN_PRICE", (_requirements select 0) select 1, _itemText]; }; }; diff --git a/SQF/dayz_code/actions/plotManagement/maintain_areaSC.sqf b/SQF/dayz_code/actions/plotManagement/maintain_areaSC.sqf index bec5e7c62..c60c84949 100644 --- a/SQF/dayz_code/actions/plotManagement/maintain_areaSC.sqf +++ b/SQF/dayz_code/actions/plotManagement/maintain_areaSC.sqf @@ -1,7 +1,7 @@ -private ["_newWealth","_missing","_missingQty","_proceed","_itemIn","_countIn","_target","_objectClasses","_range","_objects","_requirements","_count","_cost","_option"]; +private ["_newWealth","_target","_objectClasses","_range","_objects","_count","_option","_objects_filtered","_ctrl","_theCost","_wealth"]; disableSerialization; -if (DZE_ActionInProgress) exitWith { cutText [(localize "STR_EPOCH_ACTIONS_2") , "PLAIN DOWN"]; }; +if (DZE_ActionInProgress) exitWith {localize "STR_EPOCH_ACTIONS_2" call dayz_rollingMessages;}; DZE_ActionInProgress = true; player removeAction s_player_maintain_area; @@ -12,14 +12,15 @@ s_player_maintain_area_preview = 1; _target = nearestObject [[player] call FNC_getPos,"Plastic_Pole_EP1_DZ"]; _objectClasses = DZE_maintainClasses; -_range = DZE_PlotPole select 0; +_range = DZE_maintainRange; // set the max range for the maintain area _objects = nearestObjects [_target, _objectClasses, _range]; _objects_filtered = []; +_count = 0; { if (damage _x >= DZE_DamageBeforeMaint) then { _objectUID = _x getVariable ["ObjectUID","0"]; - _objectID = _x getVariable ["ObjectID","0"]; + _objectID = _x getVariable ["ObjectID","0"]; _objects_filtered set [count _objects_filtered, [_x, _objectID, _objectUID]]; _count = _count + 1; }; @@ -28,40 +29,24 @@ _objects = _objects_filtered; // TODO dynamic requirements based on used building parts? if (_count == 0) exitWith { - - _ctrl = ((uiNamespace getVariable "PlotManagement") displayCtrl 7012); - _result = format["Objects to maintain: %1" , _count]; - _ctrl ctrlSetText _result; - - _ctrl = ((uiNamespace getVariable "PlotManagement") displayCtrl 7013); - _result = format["Price to maintain: %1 %2" , 0, CurrencyName]; - - _ctrl ctrlSetText _result; + _ctrl = ((uiNamespace getVariable "PlotManagement") displayCtrl 7012); + _ctrl ctrlSetText format[localize "STR_EPOCH_PLOTMANAGEMENT_MAINTAIN_OBJECTS", _count]; + _ctrl = ((uiNamespace getVariable "PlotManagement") displayCtrl 7013); + _ctrl ctrlSetText format[localize "STR_EPOCH_PLOTMANAGEMENT_NO_MONEY_NEEDED", " "]; DZE_ActionInProgress = false; s_player_maintain_area = -1; s_player_maintain_area_preview = -1; }; -_theCost = _count * 1; -_requirements = [[CurrencyName,_theCost]]; - - +_theCost = _count * 100; _option = _this select 0; + switch _option do { case "maintain": { - _wealth = player getVariable[Z_MoneyVariable,0]; - _missing = ""; - _missingQty = 0; - _proceed = true; - { - _itemIn = _x select 0; - _countIn = _x select 1; - if (_wealth < _countIn) exitWith { _missing = _itemIn; _missingQty = (_countIn - _wealth); _proceed = false; }; - } count _requirements; - - if (_proceed) then { - _newWealth = (_wealth - _countIn); + systemChat format ["_wealth: %1 _theCost: %2",_wealth,_theCost]; + if (_theCost <= _wealth) then { + _newWealth = (_wealth - _theCost); player playActionNow "Medic"; [player,_range,true,(getPosATL player)] spawn player_alertZombies; @@ -71,52 +56,26 @@ switch _option do { PVDZE_maintainArea = [player,1,_objects]; publicVariableServer "PVDZE_maintainArea"; - - cutText [format[(localize "STR_EPOCH_ACTIONS_4"), _count], "PLAIN DOWN", 5]; - + systemChat format[localize "STR_EPOCH_ACTIONS_4", _count]; _ctrl = ((uiNamespace getVariable "PlotManagement") displayCtrl 7012); - _result = format["SUCCESS : Objects maintained: %1" , _count]; - _ctrl ctrlSetText _result; - + _ctrl ctrlSetText format[localize "STR_EPOCH_PLOTMANAGEMENT_OBJECTS_MAINTAINED_SUCCESS", _count]; _ctrl = ((uiNamespace getVariable "PlotManagement") displayCtrl 7013); - _result = format["SUCCESS : Price maintained: %1 %2" , _theCost, CurrencyName]; - _ctrl ctrlSetText _result; - + _ctrl ctrlSetText format[localize "STR_EPOCH_PLOTMANAGEMENT_PRICE_MAINTAINED_SUCCESS",_theCost, CurrencyName]; } else { _ctrl = ((uiNamespace getVariable "PlotManagement") displayCtrl 7012); - _result = format["FAILED: Objects to maintain: %1" , _count]; - _ctrl ctrlSetText _result; - + _ctrl ctrlSetText format[localize "STR_EPOCH_PLOTMANAGEMENT_OBJECTS_MAINTAINED_FAILED", _count]; _ctrl = ((uiNamespace getVariable "PlotManagement") displayCtrl 7013); - _result = format["FAILED: Price to maintain: %1 %2" , _theCost, CurrencyName]; - _ctrl ctrlSetText _result; - - cutText [format[(localize "STR_EPOCH_ACTIONS_6"), _missingQty, CurrencyName], "PLAIN DOWN"]; + _ctrl ctrlSetText format[localize "STR_EPOCH_PLOTMANAGEMENT_MONEY_NEEDED_FAILED", _theCost, CurrencyName]; }; }; case "preview": { - _cost = ""; - { - _itemIn = _x select 0; - _countIn = _x select 1; - if (_cost != "") then { - _cost = _cost + " and "; - }; - _cost = _cost + (str(_countIn) + " " + CurrencyName); - } count _requirements; - - cutText [format[(localize "STR_EPOCH_ACTIONS_7"), _count, _cost], "PLAIN DOWN"]; - _ctrl = ((uiNamespace getVariable "PlotManagement") displayCtrl 7012); - _result = format["Objects to maintain: %1" , _count]; - _ctrl ctrlSetText _result; - + _ctrl ctrlSetText format[localize "STR_EPOCH_PLOTMANAGEMENT_MAINTAIN_OBJECTS", _count]; _ctrl = ((uiNamespace getVariable "PlotManagement") displayCtrl 7013); - _result = format["Price to maintain: %1 %2" , _theCost, CurrencyName]; - _ctrl ctrlSetText _result; + _ctrl ctrlSetText format[localize "STR_EPOCH_PLOTMANAGEMENT_MAINTAIN_PRICE", _theCost, CurrencyName]; }; }; DZE_ActionInProgress = false; s_player_maintain_area = -1; -s_player_maintain_area_preview = -1; \ No newline at end of file +s_player_maintain_area_preview = -1; diff --git a/SQF/dayz_code/actions/plotManagement/plotAddFriend.sqf b/SQF/dayz_code/actions/plotManagement/plotAddFriend.sqf index 5c5ba1e95..ce33dad4b 100644 --- a/SQF/dayz_code/actions/plotManagement/plotAddFriend.sqf +++ b/SQF/dayz_code/actions/plotManagement/plotAddFriend.sqf @@ -2,14 +2,18 @@ private ["_pos","_plots","_thePlot","_inList","_toAdd","_friends"]; _pos = _this select 0; if (_pos < 0) exitWith {}; + _toAdd = (Humans select _pos); _plots = nearestObjects [[player] call FNC_getPos, ["Plastic_Pole_EP1_DZ"],15]; + _thePlot = _plots select 0; _friends = _thePlot getVariable ["plotfriends",[]]; _inList = false; + { if ((_x select 0) == (_toAdd select 0)) exitWith { _inList = true; }; } count _friends; if (_inList) exitWith {localize "STR_EPOCH_PLOTMANAGEMENT_ADDFRIEND_ALREADYONTHELIST" call dayz_rollingMessages}; if ((count _friends) == DZE_MaxPlotFriends) exitWith { format[localize "STR_EPOCH_PLOTMANAGEMENT_ADDFRIEND_FRIENDLIMIT", DZE_MaxPlotFriends] call dayz_rollingMessages;}; + _friends set [(count _friends), _toAdd]; _thePlot setVariable ["plotfriends", _friends, true]; PVDZ_veh_Save = [_thePlot,"gear"]; @@ -18,6 +22,5 @@ if (isServer) then { } else { publicVariableServer "PVDZ_veh_Save"; }; - call PlotGetFriends; -call PlotNearbyHumans; \ No newline at end of file +call PlotNearbyHumans; diff --git a/SQF/dayz_code/actions/plotManagement/plotGetFriends.sqf b/SQF/dayz_code/actions/plotManagement/plotGetFriends.sqf index 55c52f9bf..11c11593c 100644 --- a/SQF/dayz_code/actions/plotManagement/plotGetFriends.sqf +++ b/SQF/dayz_code/actions/plotManagement/plotGetFriends.sqf @@ -6,7 +6,4 @@ _thePlot = _plots select 0; _friendlies = _thePlot getVariable ["plotfriends", []]; { lbAdd [7002, toString (_x select 1)]; -} forEach _friendlies; // count causes Error Type Number, expected Bool here - - - +} forEach _friendlies; \ No newline at end of file diff --git a/SQF/dayz_code/actions/plotManagement/plotNearbyHumans.sqf b/SQF/dayz_code/actions/plotManagement/plotNearbyHumans.sqf index d43ca1bc8..2ee291bbf 100644 --- a/SQF/dayz_code/actions/plotManagement/plotNearbyHumans.sqf +++ b/SQF/dayz_code/actions/plotManagement/plotNearbyHumans.sqf @@ -10,4 +10,4 @@ Humans = []; Humans = Humans + [[_friendUID,toArray _friendName]]; lbAdd [7001, _friendName]; }; -} forEach _closePeople; // count causes Error Type Number, expected Bool here \ No newline at end of file +} forEach _closePeople; \ No newline at end of file diff --git a/SQF/dayz_code/actions/plotManagement/plotObjects.sqf b/SQF/dayz_code/actions/plotManagement/plotObjects.sqf index 23442fbbb..4ccd666cf 100644 --- a/SQF/dayz_code/actions/plotManagement/plotObjects.sqf +++ b/SQF/dayz_code/actions/plotManagement/plotObjects.sqf @@ -1,19 +1,19 @@ -private ["_range","_buildables","_count","_colour","_result","_ctrl"]; +private ["_range","_buildables","_count","_colour","_ctrl","_target"]; disableSerialization; _range = DZE_PlotPole select 0; -_buildables = DZE_maintainClasses + DZE_LockableStorage + ["DZ_buildables","DZ_storage_base"]; -_count = count (nearestObjects [[player] call FNC_getPos,_buildables,_range]); +_target = nearestObject [[player] call FNC_getPos,"Plastic_Pole_EP1_DZ"]; +_buildables = DZE_maintainClasses; +_count = count (nearestObjects [_target,_buildables,_range]); _colour = "#ffffff"; if (_count / DZE_BuildingLimit * 100 < 40) then { - _colour = "#00ff00"; + _colour = "#00ff00"; }; if (_count / DZE_BuildingLimit * 100 > 75) then { - _colour = "#ff0000"; + _colour = "#ff0000"; }; _ctrl = ((uiNamespace getVariable "PlotManagement") displayCtrl 7014); -_result = format["%1 / %2" , _count, DZE_BuildingLimit,_colour]; -_ctrl ctrlSetStructuredText parseText _result; +_ctrl ctrlSetStructuredText parseText format["%1 / %2" , _count, DZE_BuildingLimit,_colour]; \ No newline at end of file diff --git a/SQF/dayz_code/actions/plotManagement/plotRemoveFriend.sqf b/SQF/dayz_code/actions/plotManagement/plotRemoveFriend.sqf index 3c9fee22a..2061471fe 100644 --- a/SQF/dayz_code/actions/plotManagement/plotRemoveFriend.sqf +++ b/SQF/dayz_code/actions/plotManagement/plotRemoveFriend.sqf @@ -8,7 +8,7 @@ _friends = _thePlot getVariable ["plotfriends", []]; _toRemove = (_friends select _pos); _newList = []; { - if(_x select 0 != _toRemove select 0) then { + if (_x select 0 != _toRemove select 0) then { _newList set [(count _newList), _x]; }; } count _friends; diff --git a/SQF/dayz_code/actions/plotManagement/plotToggleMarkers.sqf b/SQF/dayz_code/actions/plotManagement/plotToggleMarkers.sqf index 272ba042d..fbe7a54ed 100644 --- a/SQF/dayz_code/actions/plotManagement/plotToggleMarkers.sqf +++ b/SQF/dayz_code/actions/plotManagement/plotToggleMarkers.sqf @@ -1,30 +1,28 @@ //Zero Remorse, big thanks to their scripter for this! private ["_speed","_density","_model","_thePlot","_center","_radius","_angle","_count","_axis","_obj","_idx","_a","_b"]; -//----------------------------------------------------------------------------------------- + _speed = 4; // multiplier for speed of sphere rotation/wobble _density = 3; // density of markers per ring _model = "Sign_sphere100cm_EP1"; // marker model to use on rings // Possible ones to use :: Sign_sphere10cm_EP1 Sign_sphere25cm_EP1 Sign_sphere100cm_EP1 -//----------------------------------------------------------------------------------------- -// + _thePlot = (nearestObjects [player, ["Plastic_Pole_EP1_DZ"],15]) select 0; _center = getPosASL _thePlot; _radius = DZE_PlotPole select 0; _obj = false; _tmp = -1; -//----------------------------------------------------------------------------------------- + if (!isNil "PP_Marks") then { if (((PP_Marks select 0) distance _thePlot) < 10) then { _obj = true; }; _tmp = (PP_Marks select 0) distance _thePlot; { deleteVehicle _x; } count PP_Marks; PP_Marks = nil; }; -//----------------------------------------------------------------------------------------- + if ((isNil "PP_Marks") && (!_obj)) then { PP_Marks = []; _count = round((2 * pi * _radius) / _density); - //-------------------------------------------------------------------------------- + _obj = "Sign_sphere10cm_EP1" createVehicleLocal [0,0,0]; // PARENT marker on pole _obj setPosASL [_center select 0, _center select 1, _center select 2]; _obj setObjectTexture [0, "#(argb,16,16,1)color(0,1,0,0.4)"]; _axis = _obj; _obj setVectorUp [0, 0, 0]; PP_Marks set [count PP_Marks, _obj]; - //-------------------------------------------------------------------------------- _angle = 0; for "_idx" from 0 to _count do { _a = (_center select 0) + (sin(_angle)*_radius); @@ -33,27 +31,22 @@ if ((isNil "PP_Marks") && (!_obj)) then { _obj setPosASL [_a, _b, _center select 2]; _obj setObjectTexture [0, "#(argb,16,16,1)color(0,1,0,0.4)"]; _obj attachTo [_axis]; PP_Marks set [count PP_Marks, _obj]; - //---------------------------------------------------------------------------- _a = (_center select 0) + (sin(_angle)*_radius); _b = (_center select 2) + (cos(_angle)*_radius); _obj = _model createVehicleLocal [0,0,0]; _obj setPosASL [_a, _center select 1, _b]; _obj setObjectTexture [0, "#(argb,16,16,1)color(0,1,0,0.4)"]; _obj attachTo [_axis]; PP_Marks set [count PP_Marks, _obj]; - //---------------------------------------------------------------------------- _angle = _angle + (360/_count); }; - //---------------------------------------------------------------------------- _angle = (360/_count); for "_idx" from 0 to (_count - 2) do { - //---------------------------------------------------------------------------- _a = (_center select 1) + (sin(_angle)*_radius); _b = (_center select 2) + (cos(_angle)*_radius); _obj = _model createVehicleLocal [0,0,0]; _obj setPosASL [_center select 0, _a, _b]; _obj setObjectTexture [0, "#(argb,16,16,1)color(0,1,0,0.4)"]; _obj attachTo [_axis]; PP_Marks set [count PP_Marks, _obj]; - //---------------------------------------------------------------------------- _angle = _angle + (360/_count); }; _angle = (360/_count); _axis setDir 45; @@ -64,18 +57,12 @@ if ((isNil "PP_Marks") && (!_obj)) then { _obj setPosASL [_a, _center select 1, _b]; _obj setObjectTexture [0, "#(argb,16,16,1)color(0,1,0,0.4)"]; _obj attachTo [_axis]; PP_Marks set [count PP_Marks, _obj]; - //---------------------------------------------------------------------------- _a = (_center select 1) + (sin(_angle)*_radius); _b = (_center select 2) + (cos(_angle)*_radius); _obj = _model createVehicleLocal [0,0,0]; _obj setPosASL [_center select 0, _a, _b]; _obj setObjectTexture [0, "#(argb,16,16,1)color(0,1,0,0.4)"]; _obj attachTo [_axis]; PP_Marks set [count PP_Marks, _obj]; - //---------------------------------------------------------------------------- _angle = _angle + (360/_count); }; - //-------------------------------------------------------------------------------- - //-------------------------------------------------------------------------------- }; -//------------------------------------------------------------------------------------ -//------------------------------------------------------------------------------------ diff --git a/SQF/dayz_code/init/variables.sqf b/SQF/dayz_code/init/variables.sqf index c002cbe10..ac4349d46 100644 --- a/SQF/dayz_code/init/variables.sqf +++ b/SQF/dayz_code/init/variables.sqf @@ -505,7 +505,7 @@ DZE_REPLACE_WEAPONS = [["Crossbow","DMR","M14_EP1","SVD","SVD_CAMO"],["Crossbow_ DZE_LockableStorage = ["VaultStorage","VaultStorageLocked","LockboxStorageLocked","LockboxStorage"]; DZE_LockedStorage = ["VaultStorageLocked","LockboxStorageLocked"]; DZE_UnLockedStorage = ["VaultStorage","LockboxStorage"]; -DZE_maintainClasses = ["ModularItems","DZE_Housebase","LightPole_DZ","BuiltItems","Generator_DZ","Plastic_Pole_EP1_DZ","Fence_corrugated_DZ","CanvasHut_DZ","ParkBench_DZ","MetalGate_DZ","StickFence_DZ","DesertCamoNet_DZ","ForestCamoNet_DZ","DesertLargeCamoNet_DZ","ForestLargeCamoNet_DZ","DeerStand_DZ","Scaffolding_DZ","FireBarrel_DZ"]; +DZE_maintainClasses = ["ModularItems","DZE_Housebase","LightPole_DZ","BuiltItems","Generator_DZ","DZ_buildables","Plastic_Pole_EP1_DZ","Fence_corrugated_DZ","CanvasHut_DZ","ParkBench_DZ","MetalGate_DZ","StickFence_DZ","DesertCamoNet_DZ","ForestCamoNet_DZ","DesertLargeCamoNet_DZ","ForestLargeCamoNet_DZ","DeerStand_DZ","Scaffolding_DZ","FireBarrel_DZ"]; DZE_DoorsLocked = ["Land_DZE_GarageWoodDoorLocked","Land_DZE_LargeWoodDoorLocked","Land_DZE_WoodDoorLocked","CinderWallDoorLocked_DZ","CinderWallDoorSmallLocked_DZ"]; // List of removable items that require crowbar DZE_isRemovable = ["Fence_corrugated_DZ","M240Nest_DZ","ParkBench_DZ","Plastic_Pole_EP1_DZ","FireBarrel_DZ","Scaffolding_DZ"]; diff --git a/SQF/dayz_code/stringtable.xml b/SQF/dayz_code/stringtable.xml index 66e5dba46..ff01f8455 100644 --- a/SQF/dayz_code/stringtable.xml +++ b/SQF/dayz_code/stringtable.xml @@ -16334,6 +16334,9 @@ Take Ownership: %1 objects ownership changed. + + + Objects to maintain: %1 @@ -16341,21 +16344,21 @@ Price to maintain: %1 %2 - No money needed. + No maintenance needed. Деньги не требуются. SUCCESS: Objects maintained: %1 - SUCCESS: Price maintained: %1 %2 ! + SUCCESS: Maintenance cost: %1 %2! FAILED: Objects maintained: 0 - FAILED: Money needed: %1 %2 ! - ОШИБКА: Требуется денег: %1 %2 ! + FAILED: Money needed: %1 %2! + ОШИБКА: Требуется денег: %1 %2! That user is already on the list @@ -16367,6 +16370,7 @@ Можно добавить друзей: %1 Nur %1 Freunde erlaubt + Trader Händler @@ -17821,6 +17825,9 @@ Object is placed too far away from where you started building (within %1 meters) + + + Manage Door Tür verwalten @@ -17849,7 +17856,6 @@ We do not allow manual codes. Die manuelle Eingabe ist nicht erlaubt. - Door Management Tür-Management @@ -17862,6 +17868,7 @@ You do not have the rights to manage. Du darfst diese Tür nicht verwalten. + Open Door Tür öffnen