Plot management fixes (#1735)

* Plot management fixes

This hopefully adds a few more items to the maintain list (@icomrade)
Uses epoch_returnChange to accurately and tidily return change and
handle money.
Localize maintain_area.sqf for single currency servers

* Plot Management tidyness

Fixing tidy issues

* Plot management changes

Fix maintenance variables as per @ebaydayz

* Plot management

Missed one

* Plot management fixes and default maintain_area fixes.

Convert original maintain_area.sqf to epoch_returnChange, I used the
plot management localization strings since I liked them better, the
epoch ones don't make a lot of sense really. Makes no difference if plot
management is turned off anyway.
Change the single currency version to work a lot better than it did, I
put the cost per item to 100 to be more in line with what I would expect
on a server

Changed _range to use DZE_maintainRange (DZE_plotPole select 0 + 20)
This commit is contained in:
oiad
2016-08-16 06:49:56 +12:00
committed by ebaydayz
parent fc0f0dc896
commit c738710b77
12 changed files with 101 additions and 243 deletions

View File

@@ -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;
};
};

View File

@@ -2,4 +2,4 @@ createdialog "PlotManagement";
call PlotNearbyHumans;
call PlotGetFriends;
["preview"] call MaintainPlot;
call PlotObjects;
call PlotObjects;

View File

@@ -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];
};
};

View File

@@ -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;
s_player_maintain_area_preview = -1;

View File

@@ -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;
call PlotNearbyHumans;

View File

@@ -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;

View File

@@ -10,4 +10,4 @@ Humans = [];
Humans = Humans + [[_friendUID,toArray _friendName]];
lbAdd [7001, _friendName];
};
} forEach _closePeople; // count causes Error Type Number, expected Bool here
} forEach _closePeople;

View File

@@ -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["<t color='%3'>%1 / %2</t>" , _count, DZE_BuildingLimit,_colour];
_ctrl ctrlSetStructuredText parseText _result;
_ctrl ctrlSetStructuredText parseText format["<t color='%3'>%1 / %2</t>" , _count, DZE_BuildingLimit,_colour];

View File

@@ -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;

View File

@@ -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);
};
//--------------------------------------------------------------------------------
//--------------------------------------------------------------------------------
};
//------------------------------------------------------------------------------------
//------------------------------------------------------------------------------------

View File

@@ -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"];

View File

@@ -16334,6 +16334,9 @@
<Key ID="STR_EPOCH_APLOTFORLIFE_TAKE_OWNERSHIP">
<English>Take Ownership: %1 objects ownership changed.</English>
</Key>
<!-- PLOT MANAGEMENT BELOW -->
<Key ID="STR_EPOCH_PLOTMANAGEMENT_MAINTAIN_OBJECTS">
<English>Objects to maintain: %1</English>
</Key>
@@ -16341,21 +16344,21 @@
<English>Price to maintain: %1 %2</English>
</Key>
<Key ID="STR_EPOCH_PLOTMANAGEMENT_NO_MONEY_NEEDED">
<English>No money needed.</English>
<English>No maintenance needed.</English>
<Russian>Деньги не требуются.</Russian>
</Key>
<Key ID="STR_EPOCH_PLOTMANAGEMENT_OBJECTS_MAINTAINED_SUCCESS">
<English>SUCCESS: Objects maintained: %1</English>
</Key>
<Key ID="STR_EPOCH_PLOTMANAGEMENT_PRICE_MAINTAINED_SUCCESS">
<English>SUCCESS: Price maintained: %1 %2 !</English>
<English>SUCCESS: Maintenance cost: %1 %2!</English>
</Key>
<Key ID="STR_EPOCH_PLOTMANAGEMENT_OBJECTS_MAINTAINED_FAILED">
<English>FAILED: Objects maintained: 0</English>
</Key>
<Key ID="STR_EPOCH_PLOTMANAGEMENT_MONEY_NEEDED_FAILED">
<English>FAILED: Money needed: %1 %2 !</English>
<Russian>ОШИБКА: Требуется денег: %1 %2 !</Russian>
<English>FAILED: Money needed: %1 %2!</English>
<Russian>ОШИБКА: Требуется денег: %1 %2!</Russian>
</Key>
<Key ID="STR_EPOCH_PLOTMANAGEMENT_ADDFRIEND_ALREADYONTHELIST">
<English>That user is already on the list</English>
@@ -16367,6 +16370,7 @@
<Russian>Можно добавить друзей: %1</Russian>
<German>Nur %1 Freunde erlaubt</German>
</Key>
<Key ID="STR_EPOCH_TRADER">
<English>Trader</English>
<German>Händler</German>
@@ -17821,6 +17825,9 @@
<Key ID="STR_EPOCH_BUILD_FAIL_TOO_FAR">
<English>Object is placed too far away from where you started building (within %1 meters)</English>
</Key>
<!-- DOOR MANAGEMENT BELOW -->
<Key ID="STR_EPOCH_ACTIONS_MANAGEDOOR">
<English>Manage Door</English>
<German>Tür verwalten</German>
@@ -17849,7 +17856,6 @@
<English>We do not allow manual codes.</English>
<German>Die manuelle Eingabe ist nicht erlaubt.</German>
</Key>
<Key ID="STR_EPOCH_DOORMANAGEMENT_TITLE">
<English>Door Management</English>
<German>Tür-Management</German>
@@ -17862,6 +17868,7 @@
<English>You do not have the rights to manage.</English>
<German>Du darfst diese Tür nicht verwalten.</German>
</Key>
<Key ID="STR_EPOCH_DOORS_OPEN">
<English>Open Door</English>
<German>Tür öffnen</German>