Jump to content
  • 0
AllenFromStacysmom

Change base maintain price

Question

Hey guys, I wonder if there is a way to change the default price for the base maintain.

 

This is my server_maintainArea.sqf in my server pbo

/* Maintain Area - written by Skaronator */
private ["_player","_name","_ObjArray","_uniqueID","_objects","_key"];
_player = _this select 0;
_option = _this select 1;
/*
1: PVDZE_maintainArea = [player,1,_target];
2: PVDZE_maintainArea = [player,2,_object];
*/
_targetObj = _this select 2;

if (_option == 1) then {
	_objects = nearestObjects [_targetObj, DZE_maintainClasses, DZE_maintainRange];
	{
		if (damage _x >= DZE_DamageBeforeMaint) then {
			_objectID = _x getVariable ["ObjectID","0"];
			if (_objectID == "0") then {
				_objectUID = _x getVariable ["ObjectUID","0"];
				if (_objectUID != "0") then {
					_x setDamage 0;
					_key = format["CHILD:397:%1:", _objectUID]; // use UID if not "0" && ID is "0"
					_data = "HiveExt" callExtension _key;
				};
			} else {
				_x setDamage 0;
				_key = format["CHILD:396:%1:", _objectID]; //Use ID instead of UID because ID is shorter
				_data = "HiveExt" callExtension _key;
			};
		};
	} count _objects;
	_name = if (alive _player) then { name _player; } else { "Dead Player"; };
	diag_log format ["MAINTAIN AREA BY %1 - %2 Objects at %3", _name, count _objects, (getPosATL _player)];
};
if (_option == 2) then {
	if (damage _targetObj >= DZE_DamageBeforeMaint) then {
		_objectID = _targetObj getVariable ["ObjectID","0"];
		if (_objectID == "0") then {
			_objectUID = _targetObj getVariable ["ObjectUID","0"];
			if (_objectUID != "0") then {
				_targetObj setDamage 0;
				_key = format["CHILD:397:%1:", _objectUID]; // use UID if not "0" && ID is "0"
				_data = "HiveExt" callExtension _key;
			};
		} else {
			_targetObj setDamage 0;
			_key = format["CHILD:396:%1:", _objectID]; //Use ID instead of UID because ID is shorter
			_data = "HiveExt" callExtension _key;
			
		};
	};
};

and i find this in dayz_code

maintain_area.sqf

//Code developed by Axe Cop - Massiv improvments && 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"];

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; // Plastic_Pole_EP1_DZ

_objectClasses = DZE_maintainClasses;
_range = DZE_maintainRange; // set the max range for the maintain area
_objects = nearestObjects [_target, _objectClasses, _range];

//filter to only those that have 10% damage
_objects_filtered = [];
{
    if (damage _x >= DZE_DamageBeforeMaint) then {
        _objects_filtered set [count _objects_filtered, _x];
   };
} count _objects;
_objects = _objects_filtered;

// TODO dynamic requirements based on used building parts?
_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 = [["ItemGoldBar10oz",0]]};
	case (_count <= 20):  {_requirements = [["ItemGoldBar10oz",0]]};
	case (_count <= 35):  {_requirements = [["ItemGoldBar10oz",0]]};
	case (_count <= 50):  {_requirements = [["ItemGoldBar10oz",0]]};
	case (_count <= 75):  {_requirements = [["ItemGoldBar10oz",0]]};
	case (_count <= 100): {_requirements = [["ItemBriefcase100oz",0]]};
	case (_count <= 175): {_requirements = [["ItemBriefcase100oz",0]]};
	case (_count <= 250): {_requirements = [["ItemGoldBar10oz",1]]};
	case (_count <= 325): {_requirements = [["ItemGoldBar10oz",1]]};
	case (_count <= 400): {_requirements = [["ItemGoldBar10oz",1]]};
	case (_count <= 475): {_requirements = [["ItemGoldBar10oz",3]]};
	case (_count <= 550): {_requirements = [["ItemGoldBar10oz",5]]};
	case (_count <= 625): {_requirements = [["ItemGoldBar10oz",6]]};
	case (_count > 625):  {_requirements = [["ItemBriefcase100oz",1]]};
};



_option = _this select 3;
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; };
		} count _requirements;

		if (_proceed) then {
			player playActionNow "Medic";
			[player,_range,true,(getPosATL player)] spawn player_alertZombies;

			_temp_removed_array = [];
			_removed_total = 0;
			_tobe_removed_total = 0;
			
			{
				_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 {
				cutText [format[(localize "STR_EPOCH_ACTIONS_4"), _count], "PLAIN DOWN", 5];
				PVDZE_maintainArea = [player,1,_target];
				publicVariableServer "PVDZE_maintainArea";	
			} else {
				{player addMagazine _x;} count _temp_removed_array;
				cutText [format[(localize "STR_EPOCH_ACTIONS_5"),_removed_total,_tobe_removed_total], "PLAIN DOWN"];
			};
		} else {
			_textMissing = getText(configFile >> "CfgMagazines" >> _missing >> "displayName");
			cutText [format[(localize "STR_EPOCH_ACTIONS_6"), _missingQty, _textMissing], "PLAIN DOWN"];
		};
	};
	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;
		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;

i changed the price, but in game price still didnt change

 

 

 

And not quite sure how base decay works. does it just cause damage to building or like just delete when it reachs the date

Share this post


Link to post
Share on other sites

2 answers to this question

Recommended Posts

  • 0

Place the maintain_area.sqf in your MPmission/Scripts folder. (Or what ever folder you want)

 

Open your custom fn_selfActions.sqf and search for this block of code

	 if (_canDo && (speed player <= 1) && (_cursorTarget isKindOf "Plastic_Pole_EP1_DZ")) then {
		 if (s_player_maintain_area < 0) then {
		  	s_player_maintain_area = player addAction [format["<t color='#ff0000'>%1</t>",localize "STR_EPOCH_ACTIONS_MAINTAREA"], "\z\addons\dayz_code\actions\maintain_area.sqf", "maintain", 5, false];
		 	s_player_maintain_area_preview = player addAction [format["<t color='#ff0000'>%1</t>",localize "STR_EPOCH_ACTIONS_MAINTPREV"], "\z\addons\dayz_code\actions\maintain_area.sqf", "preview", 5, false];
		 };

Change that too (remember if you placed the maintain_area.sqf inside a different folder then Scripts change the call)

	 if (_canDo && (speed player <= 1) && (_cursorTarget isKindOf "Plastic_Pole_EP1_DZ")) then {
		 if (s_player_maintain_area < 0) then {
		  	s_player_maintain_area = player addAction [format["<t color='#ff0000'>%1</t>",localize "STR_EPOCH_ACTIONS_MAINTAREA"], "Scripts\maintain_area.sqf", "maintain", 5, false];
		 	s_player_maintain_area_preview = player addAction [format["<t color='#ff0000'>%1</t>",localize "STR_EPOCH_ACTIONS_MAINTPREV"], "Scripts\maintain_area.sqf", "preview", 5, false];
		 };

No custom fn_selfAction.sqf?

Open your dayz_code.pbo and you will find it inside the compile folder. Place the fn_selfAction.sqf inside your Mpmission/Scripts folder. (Or what ever folder you want)

 

Now open your custom compiles and search for fn_selfAction.sqf and change that line to (remember if you placed the fn_selfActions.sqf inside a different folder than Scripts change the call)

fnc_usec_selfActions = compile preprocessFileLineNumbers "Scripts\fn_selfActions.sqf";

No custom compiles?

Open your dayz_code.pbo and you will find it inside the init folder. Place the compiles.sqf inside your MPmissions/Scripts folder. (Or what ever folder you want)

 

Now open your init.sqf inside your Mpmission and find

call compile preprocessFileLineNumbers "\z\addons\dayz_code\init\compiles.sqf";

change that to (remember if you placed the compiles.sqf inside a different folder than Scripts change the call)

call compile preprocessFileLineNumbers "Scripts\compiles.sqf";

That's it for that, next you need to allow players to maintain by

1) Database event that places damage on objects.

OR

2) Allow them to maintain the objects at full health.

 

Database event to place damage on objects is

DROP EVENT IF EXISTS setDamageOnAge;
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` = '[]') )
;

 

Allow maintain on full health object. Open your init.sqf inside your MPmissions and add

DZE_DamageBeforeMaint = 0;

right with the other    DZE_    (config settings)

 

For your decay question. It just deletes any placed empty item that is at or past your decay number  (in days).

 

To change your decay open your hiveExt.ini and find

;CleanupPlacedAfterDays = 6

change to

CleanupPlacedAfterDays = 6

Change to how many days a placed empty object has to be to get deleted. The number is in days.

 

Hope this helped. Cheers...

Share this post


Link to post
Share on other sites
  • 0

Place the maintain_area.sqf in your MPmission/Scripts folder. (Or what ever folder you want)

 

Open your custom fn_selfActions.sqf and search for this block of code

	 if (_canDo && (speed player <= 1) && (_cursorTarget isKindOf "Plastic_Pole_EP1_DZ")) then {
		 if (s_player_maintain_area < 0) then {
		  	s_player_maintain_area = player addAction [format["<t color='#ff0000'>%1</t>",localize "STR_EPOCH_ACTIONS_MAINTAREA"], "\z\addons\dayz_code\actions\maintain_area.sqf", "maintain", 5, false];
		 	s_player_maintain_area_preview = player addAction [format["<t color='#ff0000'>%1</t>",localize "STR_EPOCH_ACTIONS_MAINTPREV"], "\z\addons\dayz_code\actions\maintain_area.sqf", "preview", 5, false];
		 };

Change that too (remember if you placed the maintain_area.sqf inside a different folder then Scripts change the call)

	 if (_canDo && (speed player <= 1) && (_cursorTarget isKindOf "Plastic_Pole_EP1_DZ")) then {
		 if (s_player_maintain_area < 0) then {
		  	s_player_maintain_area = player addAction [format["<t color='#ff0000'>%1</t>",localize "STR_EPOCH_ACTIONS_MAINTAREA"], "Scripts\maintain_area.sqf", "maintain", 5, false];
		 	s_player_maintain_area_preview = player addAction [format["<t color='#ff0000'>%1</t>",localize "STR_EPOCH_ACTIONS_MAINTPREV"], "Scripts\maintain_area.sqf", "preview", 5, false];
		 };

No custom fn_selfAction.sqf?

Open your dayz_code.pbo and you will find it inside the compile folder. Place the fn_selfAction.sqf inside your Mpmission/Scripts folder. (Or what ever folder you want)

 

Now open your custom compiles and search for fn_selfAction.sqf and change that line to (remember if you placed the fn_selfActions.sqf inside a different folder than Scripts change the call)

fnc_usec_selfActions = compile preprocessFileLineNumbers "Scripts\fn_selfActions.sqf";

No custom compiles?

Open your dayz_code.pbo and you will find it inside the init folder. Place the compiles.sqf inside your MPmissions/Scripts folder. (Or what ever folder you want)

 

Now open your init.sqf inside your Mpmission and find

call compile preprocessFileLineNumbers "\z\addons\dayz_code\init\compiles.sqf";

change that to (remember if you placed the compiles.sqf inside a different folder than Scripts change the call)

call compile preprocessFileLineNumbers "Scripts\compiles.sqf";

That's it for that, next you need to allow players to maintain by

1) Database event that places damage on objects.

OR

2) Allow them to maintain the objects at full health.

 

Database event to place damage on objects is

DROP EVENT IF EXISTS setDamageOnAge;
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` = '[]') )
;

 

Allow maintain on full health object. Open your init.sqf inside your MPmissions and add

DZE_DamageBeforeMaint = 0;

right with the other    DZE_    (config settings)

 

For your decay question. It just deletes any placed empty item that is at or past your decay number  (in days).

 

To change your decay open your hiveExt.ini and find

;CleanupPlacedAfterDays = 6

change to

CleanupPlacedAfterDays = 6

Change to how many days a placed empty object has to be to get deleted. The number is in days.

 

Hope this helped. Cheers...

thanks

that is very detailed

ill give try it out tonight

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

  • Similar Content

    • By victorks
      my first work in editin :) https://uploaddeimagens.com.br/imagens/20180307202515_1-jpg https://uploaddeimagens.com.br/imagens/20180307202245_1-jpg DOWNLOAD: https://www.dropbox.com/s/oq97j7x59362kqe/CASTLEai.sqf?dl=0 AI M2 NEED WAI: https://pastebin.com/GJMnPvZP ON THE MAP: https://pastebin.com/cyqH9rNV  
       
      https://www.dropbox.com/s/oq97j7x59362kqe/CASTLEai.sqf?dl=0
       
       
       
       
       
       
       
       
       
    • By lesvieuxcrevards
      HI,
       
      I've questions regarding decay timer :
      What is maximum value for these timers? Does it possible to turn off ? Best Regards
    • By Forrest
      I am looking for a friend or group that can be on from 7-10 am GMT. I want to build a base. My email is [email protected], Skype is Forrest Perkins, steam is forrestmikeperkinskirk. I may be on from 10- 16 am GMT on the 18th of July, 2017 but I'm always looking for friends I can trust.
    • By harcosgoogle
      Hi!
       
      plotpole bug. Base maintanied ,The base has disappeared. Why?
       
      He was paid in vain
       
      Thanks!
    • By i3lackoutHD
      Hello guys,
      I have a big problem.
      All Bases on my Server despawn after some time.
      Im really confused - anyone with the same problem? Maybe already a fix.
      Hope someone has a answer.
       
      Blackout
  • Advertisement
  • Supporters
  • Discord

×
×
  • Create New...