Jump to content

[Release] 2.1 Plot Management - UPDATED Object Counter


Zupa

Recommended Posts

Those are loot file errors, nothing to do with Plot Management.

 

Google or search the forums for this : 

Warning Message: No entry 'bin\config.bin/CfgWeapons.'.

As for this : 

Dome does not work and neither does Maintain

You have stuffed up the Plot Management install.

Link to comment
Share on other sites

this will always return 0, you cant use an array with nearObjects.

 

That's why i said or not? Read the right above that is standing: "Since something like this wouldn't work:".. But i know it was a long post and i often don't read every single word so don't worry :P

Link to comment
Share on other sites

That's why i said or not? Read the right above that is standing: "Since something like this wouldn't work:".. But i know it was a long post and i often don't read every single word so don't worry :P

 

i posted before it was that long ...  :rolleyes:

 

you can use nearestObjects instead, if you open up the files and look at the code, there will be plenty of examples on how to do this ...

Link to comment
Share on other sites

For those that don't use P4L it seems this fix is now working for me so i offer this up as it may help others that struggled like me. 

No other changes from the install directions are needed. but testing so far seems this seems to work perfectly as long as you remember to add yourself to each plot pole you build before you die. 

 

In fn_selfctions.sqf

 if (_canDo && (speed player <= 1) && (_cursorTarget isKindOf "Plastic_Pole_EP1_DZ")) then {
if (s_player_plotManagement < 0) then {
        _adminList = [""]; // Add admins here if you admins to able to manage all plotpoles
_owner = _cursorTarget getVariable ["CharacterID","0"];
_friends = _cursorTarget getVariable ["plotfriends", []];
_fuid = [];
{
_friendUID = _x select 0;
_fuid = _fuid + [_friendUID];
} forEach _friends;
_allowed = [_owner];    
_allowed = _allowed + _adminList + _fuid;
if(_owner == dayz_characterID || (getPlayerUID player) in _allowed)then{            
s_player_plotManagement = player addAction ["<t color='#0059FF'>Manage Plot</t>", "plotManagement\initPlotManagement.sqf", [], 5, false];
};
};
} else {
    player removeAction s_player_plotManagement;
s_player_plotManagement = -1;
};

 

farther down in fn_selfActions.sqf

///Allow owners to delete modulars
if(_isModular) then {
if(_hasToolbox && "ItemCrowbar" in _itemsPlayer) then {
            _findNearestPoles = nearestObjects[player, ["Plastic_Pole_EP1_DZ"], DZE_PlotPole select 0];
            _IsNearPlot = count (_findNearestPoles);
            _fuid  = [];
            _allowed = [];
_friends = [];
if(_IsNearPlot > 0)then{
                _thePlot = _findNearestPoles select 0;
                _friends = _thePlot getVariable ["plotfriends", []];
_fuid = [];
{
                  _friendUID = _x select 0;
                  _fuid  =  _fuid  + [_friendUID];
} forEach _friends;
  _allowed = [];    
_allowed = _fuid; 
if ((getPlayerUID player) in _allowed) then {  // // If u want that the object also belongs to someone on the plotpole.
                    _player_deleteBuild = true;
   };                  
               };
            };                                        
        };
 
 
//Allow owners to delete modular doors without locks
if(_isModularDoor) then {
        if(_hasToolbox && "ItemCrowbar" in _itemsPlayer) then {         
            _findNearestPoles = nearestObjects[player, ["Plastic_Pole_EP1_DZ"], DZE_PlotPole select 0];
            _IsNearPlot = count (_findNearestPoles);
            _fuid  = [];
            _allowed = [];
_friends = [];
if(_IsNearPlot > 0)then{
                _thePlot = _findNearestPoles select 0;
                _friends = _thePlot getVariable ["plotfriends", []];
_fuid = [];
{
                  _friendUID = _x select 0;
                  _fuid  =  _fuid  + [_friendUID];
} forEach _friends;
  _allowed = [];    
_allowed = _fuid; 
if ((getPlayerUID player) in _allowed) then {  // // If u want that the object also belongs to someone on the plotpole.
                    _player_deleteBuild = true;
                };                  
            };                              
        };      
};

Link to comment
Share on other sites

Im having some trouble getting the maintenance to work. I click the maintenance tab and nothing happens. Everything else seems to work fine. Im using the maintain_areaSC.sqf because I use soul's coin system. Im all for looking through the threads, and I made a valiant effort.. I got through about ~20 pages before my head exploded... but I didnt see anything related to the maintenance script. So if anyone would be kind enough to point out what Im doing wrong that'd be great!

Link to comment
Share on other sites

Without trying to sound condescending, you do have maintenance enabled on your server, right?

CleanupPlacedAfterDays = 21 
DROP EVENT IF EXISTS `setDamageOnAge`;
DELIMITER ;;
CREATE EVENT `setDamageOnAge` ON SCHEDULE EVERY 1 DAY COMMENT 'This sets damage on a wall so that it can be maintained' DO UPDATE `Object_DATA` SET `Damage`=0.1 WHERE `ObjectUID` <> 0 AND `CharacterID` <> 0 AND `Datestamp` < DATE_SUB(CURRENT_TIMESTAMP, INTERVAL 3 DAY) AND ( (`Inventory` IS NULL) OR (`Inventory` = '[]') )
;;
DELIMITER ; 

Etc, etc.

 

Sorry man, have to ask :)

Link to comment
Share on other sites

Without trying to sound condescending, you do have maintenance enabled on your server, right?

CleanupPlacedAfterDays = 21 
DROP EVENT IF EXISTS `setDamageOnAge`;
DELIMITER ;;
CREATE EVENT `setDamageOnAge` ON SCHEDULE EVERY 1 DAY COMMENT 'This sets damage on a wall so that it can be maintained' DO UPDATE `Object_DATA` SET `Damage`=0.1 WHERE `ObjectUID` <> 0 AND `CharacterID` <> 0 AND `Datestamp` < DATE_SUB(CURRENT_TIMESTAMP, INTERVAL 3 DAY) AND ( (`Inventory` IS NULL) OR (`Inventory` = '[]') )
;;
DELIMITER ; 

Etc, etc.

 

Sorry man, have to ask :)

LOL no problem and yes Ive been using this for quite awhile now.just fine. Ive only recently been inspired to add plot management because everyone told me it was working fine.

OLD

private ["_newWealth","_missing","_missingQty","_proceed","_itemIn","_countIn","_target","_objectClasses","_range","_objects","_requirements","_count","_cost","_option"];

if (DZE_ActionInProgress) exitWith { cutText [(localize "STR_EPOCH_ACTIONS_2") , "PLAIN DOWN"]; };

DZE_ActionInProgress = true;

player removeAction s_player_maintain_area;
s_player_maintain_area = 1;
player removeAction s_player_maintain_area_preview;
s_player_maintain_area_preview = 1;

_target = cursorTarget;
_objectClasses = DZE_maintainClasses;
_range = DZE_maintainRange;
_objects = nearestObjects [_target, _objectClasses, _range];
_objects_filtered = [];

{
    if (damage _x >= DZE_DamageBeforeMaint) then {
        _objects_filtered set [count _objects_filtered, _x];
   };
} count _objects;

_objects = _objects_filtered;
_count = count _objects;

if (_count == 0) exitWith {
	cutText [format[(localize "STR_EPOCH_ACTIONS_22"), _count], "PLAIN DOWN"];
	DZE_ActionInProgress = false;
	s_player_maintain_area = -1;
	s_player_maintain_area_preview = -1;
};

_requirements = [];

switch true do {
	case (_count <= 10): {_requirements = [[CurrencyName,200]]};
	case (_count <= 20): {_requirements = [[CurrencyName,300]]};
	case (_count <= 35): {_requirements = [[CurrencyName,400]]};
	case (_count <= 50): {_requirements = [[CurrencyName,500]]};
	case (_count <= 75): {_requirements = [[CurrencyName,900]]};
	case (_count <= 100): {_requirements = [[CurrencyName,1000]]};
	case (_count <= 175): {_requirements = [[CurrencyName,2000]]};
	case (_count <= 250): {_requirements = [[CurrencyName,3000]]};
	case (_count <= 325): {_requirements = [[CurrencyName,4000]]};
	case (_count <= 400): {_requirements = [[CurrencyName,5000]]};
	case (_count <= 475): {_requirements = [[CurrencyName,6000]]};
	case (_count <= 550): {_requirements = [[CurrencyName,7000]]};
	case (_count <= 625): {_requirements = [[CurrencyName,8000]]};
	case (_count > 625):  {_requirements = [[CurrencyName,9000]]};
};

_option = _this select 3;

switch _option do {

	case "maintain": {

		_wealth = player getVariable["cashMoney",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);

			player playActionNow "Medic";
			[player,_range,true,(getPosATL player)] spawn player_alertZombies;

			player setVariable["cashMoney",_newWealth,true];

			PVDZE_plr_Save = [player,(magazines player),true,true];
			publicVariableServer "PVDZE_plr_Save";

			PVDZE_maintainArea = [player,1,_target];
			publicVariableServer "PVDZE_maintainArea";

			cutText [format[(localize "STR_EPOCH_ACTIONS_4"), _count], "PLAIN DOWN", 5];	

		} else {

			cutText [format[(localize "STR_EPOCH_ACTIONS_6"), _missingQty, CurrencyName], "PLAIN DOWN"];

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

	};
};

DZE_ActionInProgress = false;
s_player_maintain_area = -1;
s_player_maintain_area_preview = -1;

 

NEW

private ["_newWealth","_missing","_missingQty","_proceed","_itemIn","_countIn","_target","_objectClasses","_range","_objects","_requirements","_count","_cost","_option"];
disableSerialization;

if (DZE_ActionInProgress) exitWith { cutText [(localize "STR_EPOCH_ACTIONS_2") , "PLAIN DOWN"]; };
DZE_ActionInProgress = true;

player removeAction s_player_maintain_area;
s_player_maintain_area = 1;
player removeAction s_player_maintain_area_preview;
s_player_maintain_area_preview = 1;

_target = cursorTarget;

_objectClasses = DZE_maintainClasses;
_range = DZE_PlotPole select 0;
_objects = nearestObjects [_target, _objectClasses, _range];

_objects_filtered = [];
{
    if (damage _x >= DZE_DamageBeforeMaint) then {
        _objects_filtered set [count _objects_filtered, _x];
   };
} count _objects;
_objects = _objects_filtered;

_count = count _objects;

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;	
	DZE_ActionInProgress = false;
	s_player_maintain_area = -1;
	s_player_maintain_area_preview = -1;
};

_theCost = _count * 10;
_requirements = [[CurrencyName,_theCost]];

/*
switch true do {
	case (_count <= 10): {_requirements = [[CurrencyName,200]]};
	case (_count <= 20): {_requirements = [[CurrencyName,300]]};
	case (_count <= 35): {_requirements = [[CurrencyName,400]]};
	case (_count <= 50): {_requirements = [[CurrencyName,500]]};
	case (_count <= 75): {_requirements = [[CurrencyName,900]]};
	case (_count <= 100): {_requirements = [[CurrencyName,1000]]};
	case (_count <= 175): {_requirements = [[CurrencyName,2000]]};
	case (_count <= 250): {_requirements = [[CurrencyName,3000]]};
	case (_count <= 325): {_requirements = [[CurrencyName,4000]]};
	case (_count <= 400): {_requirements = [[CurrencyName,5000]]};
	case (_count <= 475): {_requirements = [[CurrencyName,6000]]};
	case (_count <= 550): {_requirements = [[CurrencyName,7000]]};
	case (_count <= 625): {_requirements = [[CurrencyName,8000]]};
	case (_count > 625):  {_requirements = [[CurrencyName,9000]]};
};
*/
_option = _this select 0;
switch _option do {
	case "maintain": {
		
		_wealth = player getVariable["cashMoney",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);
			player playActionNow "Medic";
			[player,_range,true,(getPosATL player)] spawn player_alertZombies;

			player setVariable["cashMoney",_newWealth,true];

			PVDZE_plr_Save = [player,(magazines player),true,true];
			publicVariableServer "PVDZE_plr_Save";
			
			PVDZE_maintainArea = [player,1,_target];
			publicVariableServer "PVDZE_maintainArea";
			
			
			cutText [format[(localize "STR_EPOCH_ACTIONS_4"), _count], "PLAIN DOWN", 5];			
			
			_ctrl = ((uiNamespace getVariable "PlotManagement") displayCtrl 7012);
			_result =  format["SUCCESS : Objects maintained: %1" , _count];
			_ctrl ctrlSetText   _result;
		
			_ctrl = ((uiNamespace getVariable "PlotManagement") displayCtrl 7013);
			_result =  format["SUCCESS : Price maintained: %1 %2" , _theCost, CurrencyName];
			_ctrl ctrlSetText   _result;	
				
		} else {
			_ctrl = ((uiNamespace getVariable "PlotManagement") displayCtrl 7012);
			_result =  format["FAILED: Objects to maintain: %1" , _count];
			_ctrl ctrlSetText   _result;
		
			_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"];
		};
	};
	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 = ((uiNamespace getVariable "PlotManagement") displayCtrl 7013);
	    _result =  format["Price to maintain: %1 %2" , _theCost, CurrencyName];
		_ctrl ctrlSetText   _result;								
	};
};

DZE_ActionInProgress = false;
s_player_maintain_area = -1;
s_player_maintain_area_preview = -1;

 

EDIT - I do see this in my client RPT

Error Undefined variable in expression: maintainplot
File mpmissions\__CUR_MP.chernarus\plotManagement\initPlotManagement.sqf, line 4
Link to comment
Share on other sites

 

Do you have these in your compiles? 

MaintainPlot    	= compile preprocessFileLineNumbers "plotManagement\maintain_area.sqf";
PlotPreview    		= compile preprocessFileLineNumbers "plotManagement\plotToggleMarkers.sqf";

HAHAHA thanks man I knew it was something completely dumb. This is why you don't edit scripts at 3AM

Link to comment
Share on other sites

Don´t work for me....

 

Have followed the instructions now for the 10th time. Step by Step checked all files.

 

when i build a PP and add a Friend he can´t build. Only when i tagged him friendly he can build....

 

 

any fix for this or need something?

Link to comment
Share on other sites

Hi everyone,

 

is there a way to restrict players so that they only can have one plot pole? I use Zupa's Plot Pole Management and players who are listed in the Plot Management only should be able to build on this Plot Pole and should not have the opportunity to build a other Plot Pole. Is it possible to configure this?

 

Best regards,

 

GudrunGisela

Link to comment
Share on other sites

Hi everyone,

 

is there a way to restrict players so that they only can have one plot pole? I use Zupa's Plot Pole Management and players who are listed in the Plot Management only should be able to build on this Plot Pole and should not have the opportunity to build a other Plot Pole. Is it possible to configure this?

 

Best regards,

 

GudrunGisela

 

it would be a mess and might take some time to run through if you have a lot of plotpoles on your server ... but possible, yes

Link to comment
Share on other sites

I searched in this thread for my problem, but didn't find a solution for it.
 

When I add a friend to the plot he can build, all fine.

But when I remove him again, he's gone from the list, but after a restart he's back in the list. :blink:

Any ideas?

 

Using Single Currency 3.0 from Zupa, Advanced Trading, Snap Pro, Vector & Precise Building so far.

 

Thanks in advance.

Link to comment
Share on other sites

 

Don´t work for me....

 

Have followed the instructions now for the 10th time. Step by Step checked all files.

 

when i build a PP and add a Friend he can´t build. Only when i tagged him friendly he can build....

 

 

any fix for this?

 

Here is my Serverlog: http://pastebin.com/8MRp6DG3

 

 

Here is my Clientlog: http://pastebin.com/TZnh4ai1

 

make sure you go through all of the threads and find the fixes people posted

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...