Jump to content

[Release] 2.1 Plot Management - UPDATED Object Counter


Zupa

Recommended Posts

as i (and others) mentioned before both you and caveman1 need to add a line to reconize playeruid ... if you are too lazy to read what has been said before it will obviusly not work.

Not lazyness on my part at least. I read through this forum a few times.Just couldn't get my brain around the deviations fom the instructios.But thanks for the tip. I'll go back and try again.

Link to comment
Share on other sites

You can edit those files, but you need to pull them out of the dayz code and put them on your server or mission and then change where they are called from. The reason why you dont leave them in the dayz code and edit them there is because

 

The reason why you merge files is so your mods don't conflict with eachother.

 

So then why in the install process Zupa doesn't mention what you say?

Link to comment
Share on other sites

So then why in the install process Zupa doesn't mention what you say?

Probably because Zupa already assumes you know this, since it's a really basic step. He is telling you to modify your compiles.sqf to redirect certain files to the plotmanagement folder in your mission pbo. Which means he's either A. assuming you know these basic steps before you start modding your server B. simplifying the install instructions as much as possible for new admins or C. Both of those.

 

Like I said this is very basic stuff so perhaps you should spend some time googling around or maybe even go back over to good ole opendayz.net and read up on some of the resources provided.

Link to comment
Share on other sites

Probably because Zupa already assumes you know this, since it's a really basic step. He is telling you to modify your compiles.sqf to redirect certain files to the plotmanagement folder in your mission pbo. Which means he's either A. assuming you know these basic steps before you start modding your server B. simplifying the install instructions as much as possible for new admins or C. Both of those.

 

Like I said this is very basic stuff so perhaps you should spend some time googling around or maybe even go back over to good ole opendayz.net and read up on some of the resources provided.

 

FIXED. For those like me who had the same "upgrade" problem DangerRuss was right (thanks for your help). Those files needed to be moved and called from the custom fn_selfactions in your mission folder.

 

Info found here

Link to comment
Share on other sites

I have 2 seperent but how do i merge them?

use notepad ++ and run a comparison. then add all of the stuff thats different from 1 file into the other. Then go to where you call the defines.hpp and make sure only the one you've merged everything into is being called.

They should be almost exactly the same with the only differences being whatever was added to them for the mods.

Link to comment
Share on other sites

ok I've read through this entire thread for the 6th time and still am having the remove problem. I'm not using plot for life. All other functions... building and upgrading work fine even after death. Just can't remove anything even after just building it. Any hints or pointers would be greatly appreciated.  no errors in server or client also. 

 

Fn_selfActions.sqf

// logic vars
_player_flipveh = false;
_player_deleteBuild = false;
_player_lockUnlock_crtl = false;
 
if (_canDo && (speed player <= 1) && (_cursorTarget isKindOf "Plastic_Pole_EP1_DZ")) then {
diag_log format["[PlotManagement]: player plotmanagement check"];
if (s_player_plotManagement < 0) then {
        _adminList = [""]; // Add admins here if you admins to able to manage all plotpoles
diag_log format["[PlotManagement]: player is admin"];
_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;
};
 
// CURSOR TARGET ALIVE
if(_isAlive) then {
 
//Allow player to delete objects
if(_isDestructable || _isWreck || _isRemovable || _isWreckBuilding) then {
if(_hasToolbox && "ItemCrowbar" in _itemsPlayer) then {
_player_deleteBuild = true;
};
};
 
///Allow owners to delete modulars
if(_isModular) then {
        if(_hasToolbox && "ItemCrowbar" in _itemsPlayer) then {
_playerUID = getPlayerUID player;
            _findNearestPoles = nearestObjects[player, ["Plastic_Pole_EP1_DZ"], DZE_PlotPole select 0];
            _IsNearPlot = count (_findNearestPoles);
            _fuid  = [];
            _allowed = [];
            if(_IsNearPlot > 0)then{
                _thePlot = _findNearestPoles select 0;
                _owner =  _thePlot getVariable ["ownerPUID","010"];
                _friends = _thePlot getVariable ["plotfriends", []];
                {
                  _friendUID = _x select 0;
                  _fuid  =  _fuid  + [_friendUID];
                } forEach _friends;
                _allowed = [_owner];    
                _allowed = [_owner] +  _fuid;   
                if ( _playerUID in _allowed && _ownerID in _allowed ) then {  // // If u want that the object also belongs to someone on the plotpole.
                    _player_deleteBuild = true;
                };                  
            }else{
                if(_ownerID == _playerUID)then{
                    _player_deleteBuild = true;
                };
            };                                        
        };
};
//Allow owners to delete modular doors without locks
if(_isModularDoor) then {
        if(_hasToolbox && "ItemCrowbar" in _itemsPlayer) then {
_playerUID = getPlayerUID player;
            _findNearestPoles = nearestObjects[player, ["Plastic_Pole_EP1_DZ"], DZE_PlotPole select 0];
            _IsNearPlot = count (_findNearestPoles);
            _fuid  = [];
            _allowed = [];
            if(_IsNearPlot > 0)then{
                _thePlot = _findNearestPoles select 0;
                _owner =  _thePlot getVariable ["ownerPUID","010"];
                _friends = _thePlot getVariable ["plotfriends", []];
                {
                  _friendUID = _x select 0;
                  _fuid  =  _fuid  + [_friendUID];
                } forEach _friends;
                _allowed = [_owner];    
                _allowed = [_owner] +  _fuid;   
                if ( _playerUID in _allowed && _ownerID in _allowed) then { //  // If u want that the object also belongs to someone on the plotpole.
                    _player_deleteBuild = true;
                };                  
            }else{
                if(_ownerID == _playerUID)then{
                    _player_deleteBuild = true;
                };
            };                              
        };      
};
 
// CURSOR TARGET VEHICLE
if(_isVehicle) then {
 
//flip vehicle small vehicles by your self && all other vehicles with help nearby
if (!(canmove _cursorTarget) && (player distance _cursorTarget >= 2) && (count (crew _cursorTarget))== 0 && ((vectorUp _cursorTarget) select 2) < 0.5) then {
_playersNear = {isPlayer _x} count (player nearEntities ["CAManBase", 6]);
if(_isVehicletype || (_playersNear >= 2)) then {
_player_flipveh = true;
};
};
 
 
if(!_isMan && _ownerID != "0" && !(_cursorTarget isKindOf "Bicycle")) then {
_player_lockUnlock_crtl = true;
};
 
};
};
 
if(_player_deleteBuild) then {
if (s_player_deleteBuild < 0) then {
s_player_deleteBuild = player addAction [format[localize "str_actions_delete",_text], "plotManagement\remove.sqf",_cursorTarget, 1, true, true, "", ""];
};
} else {
player removeAction s_player_deleteBuild;
s_player_deleteBuild = -1;
};

 
remove.sqf

/*
delete object from db with extra waiting by [VB]AWOL
parameters: _obj
*/
private ["_activatingPlayer","_builder","_fuid","_friendUID","_obj","_objectID","_objectUID","_started","_finished","_animState","_isMedic","_isOk","_proceed","_counter","_limit","_objType","_sfx","_dis","_itemOut","_countOut","_selectedRemoveOutput","_friendlies","_nearestPole","_ownerID","_refundpart","_isWreck","_findNearestPoles","_findNearestPole","_IsNearPlot","_brokenTool","_removeTool","_isDestructable","_isRemovable","_objOwnerID","_isOwnerOfObj","_preventRefund","_ipos","_item","_radius","_isWreckBuilding","_nameVehicle","_isModular"];
 
if(DZE_ActionInProgress) exitWith { cutText [(localize "str_epoch_player_88") , "PLAIN DOWN"]; };
DZE_ActionInProgress = true;
 
player removeAction s_player_deleteBuild;
s_player_deleteBuild = 1;
 
_obj = _this select 3;
 
_activatingPlayer = player;
 
_objOwnerID = _obj getVariable["CharacterID","0"];
_isOwnerOfObj = (_objOwnerID == dayz_characterID);
 
if (_obj in DZE_DoorsLocked) exitWith { DZE_ActionInProgress = false; cutText [(localize "STR_EPOCH_ACTIONS_20"), "PLAIN DOWN"];};
if(_obj getVariable ["GeneratorRunning", false]) exitWith {DZE_ActionInProgress = false; cutText [(localize "str_epoch_player_89"), "PLAIN DOWN"];};
 
_objectID = _obj getVariable ["ObjectID","0"];
_objectUID = _obj getVariable ["ObjectUID","0"];
 
_isOk = true;
_proceed = false;
_objType = typeOf _obj;
 
// Chance to break tools
_isDestructable = _obj isKindOf "BuiltItems";
_isWreck = _objType in DZE_isWreck;
_isRemovable = _objType in DZE_isRemovable;
_isWreckBuilding = _objType in DZE_isWreckBuilding;
_isMine = _objType in ["Land_iron_vein_wreck","Land_silver_vein_wreck","Land_gold_vein_wreck"];
_isModular = _obj isKindOf "ModularItems";
 
_limit = 3;
if (DZE_StaticConstructionCount > 0) then {
_limit = DZE_StaticConstructionCount;
}
else {
if (isNumber (configFile >> "CfgVehicles" >> _objType >> "constructioncount")) then {
_limit = getNumber(configFile >> "CfgVehicles" >> _objType >> "constructioncount");
};
};
 
_findNearestPoles = nearestObjects[player, ["Plastic_Pole_EP1_DZ"], 30];
_findNearestPole = [];
{if (alive _x) then {_findNearestPole set [(count _findNearestPole),_x];};} count _findNearestPoles;
 
_IsNearPlot = count (_findNearestPole);
 
if(_IsNearPlot >= 1) then {
 
_nearestPole = _findNearestPole select 0;
 
// Find owner
_ownerID = _nearestPole getVariable["CharacterID","0"];
 
// check if friendly to owner
if(dayz_characterID != _ownerID) then {
_friendlies = _nearestPole getVariable ["plotfriends",[]];
_fuid  = [];
{
_friendUID = _x select 0;
_fuid  =  _fuid  + [_friendUID];
} forEach _friendlies;
_builder  = getPlayerUID player;
// check if friendly to owner
if(_builder in _fuid) then {
_canBuildOnPlot = true;
};
 
};
};
 
_nameVehicle = getText(configFile >> "CfgVehicles" >> _objType >> "displayName");
 
cutText [format[(localize "str_epoch_player_162"),_nameVehicle], "PLAIN DOWN"];
 
if (_isModular) then {
     //allow previous cutText to show, then show this if modular.
     cutText [(localize "STR_EPOCH_ACTIONS_21"), "PLAIN DOWN"];
};
 
// Alert zombies once.
[player,50,true,(getPosATL player)] spawn player_alertZombies;
 
_brokenTool = false;
 
// Start de-construction loop
_counter = 0;
while {_isOk} do {
 
// if object no longer exits this should return true.
if(isNull(_obj)) exitWith {
_isOk = false;
_proceed = false;
};
[1,1] call dayz_HungerThirst;
player playActionNow "Medic";
_dis=20;
[player,_dis,true,(getPosATL player)] spawn player_alertZombies;
 
r_interrupt = false;
_animState = animationState player;
r_doLoop = true;
_started = false;
_finished = false;
 
while {r_doLoop} do {
_animState = animationState player;
_isMedic = ["medic",_animState] call fnc_inString;
if (_isMedic) then {
_started = true;
};
if (_started && !_isMedic) then {
r_doLoop = false;
_finished = true;
_sfx = "repair";
[player,_sfx,0,false,_dis] call dayz_zombieSpeak;
};
if (r_interrupt) then {
r_doLoop = false;
};
 
sleep 0.1;
 
};
 
if(!_finished) exitWith {
_isOk = false;
_proceed = false;
};
 
if(_finished) then {
_counter = _counter + 1;
// 10% chance to break a required tool each pass
if((_isDestructable || _isRemovable) && !_isOwnerOfObj) then {
if((random 10) <= 1) then {
_brokenTool = true;
};
};
};
if(_brokenTool) exitWith {
_isOk = false;
_proceed = false;
};
 
cutText [format[(localize "str_epoch_player_163"), _nameVehicle, _counter,_limit], "PLAIN DOWN"];
 
if(_counter == _limit) exitWith {
_isOk = false;
_proceed = true;
};
 
};
 
 
 
if(_brokenTool) then {
if(_isWreck) then {
_removeTool = "ItemToolbox";
} else {
_removeTool = ["ItemCrowbar","ItemToolbox"] call BIS_fnc_selectRandom;
};
if(([player,_removeTool,1] call BIS_fnc_invRemove) > 0) then {
cutText [format[(localize "str_epoch_player_164"),getText(configFile >> "CfgWeapons" >> _removeTool >> "displayName"),_nameVehicle], "PLAIN DOWN"];
};
};
 
// Remove only if player waited
if (_proceed) then {
 
// Double check that object is not null
if(!isNull(_obj)) then {
 
_ipos = getPosATL _obj;
 
deleteVehicle _obj;
 
if(!_isWreck) then {
PVDZE_obj_Delete = [_objectID,_objectUID,_activatingPlayer];
publicVariableServer "PVDZE_obj_Delete";
};
 
cutText [format[(localize "str_epoch_player_165"),_nameVehicle], "PLAIN DOWN"];
 
_preventRefund = false;
 
_selectedRemoveOutput = [];
if(_isWreck) then {
// Find one random part to give back
_refundpart = ["PartEngine","PartGeneric","PartFueltank","PartWheel","PartGlass","ItemJerrycan"] call BIS_fnc_selectRandom;
_selectedRemoveOutput set [count _selectedRemoveOutput,[_refundpart,1]];
} else {
if(_isWreckBuilding) then {
_selectedRemoveOutput = getArray (configFile >> "CfgVehicles" >> _objType >> "removeoutput");
} else {
_selectedRemoveOutput = getArray (configFile >> "CfgVehicles" >> _objType >> "removeoutput");
_preventRefund = (_objectID == "0" && _objectUID == "0");
 
};
};
 
if((count _selectedRemoveOutput) <= 0) then {
cutText [(localize "str_epoch_player_90"), "PLAIN DOWN"];
};
 
if (_ipos select 2 < 0) then {
_ipos set [2,0];
};
 
_radius = 1;
 
if (_isMine) then {
if((random 10) <= 4) then {
_gems = ["ItemTopaz","ItemObsidian","ItemSapphire","ItemAmethyst","ItemEmerald","ItemCitrine","ItemRuby"];
_gem = _gems select (floor(random (count _gems)));
_selectedRemoveOutput set [(count _selectedRemoveOutput),[_gem,1]];
};
};
 
// give refund items
if((count _selectedRemoveOutput) > 0 && !_preventRefund) then {
_item = createVehicle ["WeaponHolder", _iPos, [], _radius, "CAN_COLLIDE"];
{
_itemOut = _x select 0;
_countOut = _x select 1;
if (typeName _countOut == "ARRAY") then {
_countOut = round((random (_countOut select 1)) + (_countOut select 0));
};
_item addMagazineCargoGlobal [_itemOut,_countOut];
} count _selectedRemoveOutput;
 
_item setposATL _iPos;
 
player reveal _item;
 
player action ["Gear", _item];
};
} else {
cutText [(localize "str_epoch_player_91"), "PLAIN DOWN"];
};
 
} else {
r_interrupt = false;
if (vehicle player == player) then {
[objNull, player, rSwitchMove,""] call RE;
player playActionNow "stop";
};
};
DZE_ActionInProgress = false;
s_player_deleteBuild = -1;

Link to comment
Share on other sites

 

ok I've read through this entire thread for the 6th time and still am having the remove problem. I'm not using plot for life. All other functions... building and upgrading work fine even after death. Just can't remove anything even after just building it. Any hints or pointers would be greatly appreciated.  no errors in server or client also. 

 

Fn_selfActions.sqf

// logic vars
_player_flipveh = false;
_player_deleteBuild = false;
_player_lockUnlock_crtl = false;
 
if (_canDo && (speed player <= 1) && (_cursorTarget isKindOf "Plastic_Pole_EP1_DZ")) then {
diag_log format["[PlotManagement]: player plotmanagement check"];
if (s_player_plotManagement < 0) then {
        _adminList = [""]; // Add admins here if you admins to able to manage all plotpoles
diag_log format["[PlotManagement]: player is admin"];
_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;
};
 
// CURSOR TARGET ALIVE
if(_isAlive) then {
 
//Allow player to delete objects
if(_isDestructable || _isWreck || _isRemovable || _isWreckBuilding) then {
if(_hasToolbox && "ItemCrowbar" in _itemsPlayer) then {
_player_deleteBuild = true;
};
};
 
///Allow owners to delete modulars
if(_isModular) then {
        if(_hasToolbox && "ItemCrowbar" in _itemsPlayer) then {
_playerUID = getPlayerUID player;
            _findNearestPoles = nearestObjects[player, ["Plastic_Pole_EP1_DZ"], DZE_PlotPole select 0];
            _IsNearPlot = count (_findNearestPoles);
            _fuid  = [];
            _allowed = [];
            if(_IsNearPlot > 0)then{
                _thePlot = _findNearestPoles select 0;
                _owner =  _thePlot getVariable ["ownerPUID","010"];
                _friends = _thePlot getVariable ["plotfriends", []];
                {
                  _friendUID = _x select 0;
                  _fuid  =  _fuid  + [_friendUID];
                } forEach _friends;
                _allowed = [_owner];    
                _allowed = [_owner] +  _fuid;   
                if ( _playerUID in _allowed && _ownerID in _allowed ) then {  // // If u want that the object also belongs to someone on the plotpole.
                    _player_deleteBuild = true;
                };                  
            }else{
                if(_ownerID == _playerUID)then{
                    _player_deleteBuild = true;
                };
            };                                        
        };
};
//Allow owners to delete modular doors without locks
if(_isModularDoor) then {
        if(_hasToolbox && "ItemCrowbar" in _itemsPlayer) then {
_playerUID = getPlayerUID player;
            _findNearestPoles = nearestObjects[player, ["Plastic_Pole_EP1_DZ"], DZE_PlotPole select 0];
            _IsNearPlot = count (_findNearestPoles);
            _fuid  = [];
            _allowed = [];
            if(_IsNearPlot > 0)then{
                _thePlot = _findNearestPoles select 0;
                _owner =  _thePlot getVariable ["ownerPUID","010"];
                _friends = _thePlot getVariable ["plotfriends", []];
                {
                  _friendUID = _x select 0;
                  _fuid  =  _fuid  + [_friendUID];
                } forEach _friends;
                _allowed = [_owner];    
                _allowed = [_owner] +  _fuid;   
                if ( _playerUID in _allowed && _ownerID in _allowed) then { //  // If u want that the object also belongs to someone on the plotpole.
                    _player_deleteBuild = true;
                };                  
            }else{
                if(_ownerID == _playerUID)then{
                    _player_deleteBuild = true;
                };
            };                              
        };      
};
 
// CURSOR TARGET VEHICLE
if(_isVehicle) then {
 
//flip vehicle small vehicles by your self && all other vehicles with help nearby
if (!(canmove _cursorTarget) && (player distance _cursorTarget >= 2) && (count (crew _cursorTarget))== 0 && ((vectorUp _cursorTarget) select 2) < 0.5) then {
_playersNear = {isPlayer _x} count (player nearEntities ["CAManBase", 6]);
if(_isVehicletype || (_playersNear >= 2)) then {
_player_flipveh = true;
};
};
 
 
if(!_isMan && _ownerID != "0" && !(_cursorTarget isKindOf "Bicycle")) then {
_player_lockUnlock_crtl = true;
};
 
};
};
 
if(_player_deleteBuild) then {
if (s_player_deleteBuild < 0) then {
s_player_deleteBuild = player addAction [format[localize "str_actions_delete",_text], "plotManagement\remove.sqf",_cursorTarget, 1, true, true, "", ""];
};
} else {
player removeAction s_player_deleteBuild;
s_player_deleteBuild = -1;
};

 
remove.sqf

/*
delete object from db with extra waiting by [VB]AWOL
parameters: _obj
*/
private ["_activatingPlayer","_builder","_fuid","_friendUID","_obj","_objectID","_objectUID","_started","_finished","_animState","_isMedic","_isOk","_proceed","_counter","_limit","_objType","_sfx","_dis","_itemOut","_countOut","_selectedRemoveOutput","_friendlies","_nearestPole","_ownerID","_refundpart","_isWreck","_findNearestPoles","_findNearestPole","_IsNearPlot","_brokenTool","_removeTool","_isDestructable","_isRemovable","_objOwnerID","_isOwnerOfObj","_preventRefund","_ipos","_item","_radius","_isWreckBuilding","_nameVehicle","_isModular"];
 
if(DZE_ActionInProgress) exitWith { cutText [(localize "str_epoch_player_88") , "PLAIN DOWN"]; };
DZE_ActionInProgress = true;
 
player removeAction s_player_deleteBuild;
s_player_deleteBuild = 1;
 
_obj = _this select 3;
 
_activatingPlayer = player;
 
_objOwnerID = _obj getVariable["CharacterID","0"];
_isOwnerOfObj = (_objOwnerID == dayz_characterID);
 
if (_obj in DZE_DoorsLocked) exitWith { DZE_ActionInProgress = false; cutText [(localize "STR_EPOCH_ACTIONS_20"), "PLAIN DOWN"];};
if(_obj getVariable ["GeneratorRunning", false]) exitWith {DZE_ActionInProgress = false; cutText [(localize "str_epoch_player_89"), "PLAIN DOWN"];};
 
_objectID = _obj getVariable ["ObjectID","0"];
_objectUID = _obj getVariable ["ObjectUID","0"];
 
_isOk = true;
_proceed = false;
_objType = typeOf _obj;
 
// Chance to break tools
_isDestructable = _obj isKindOf "BuiltItems";
_isWreck = _objType in DZE_isWreck;
_isRemovable = _objType in DZE_isRemovable;
_isWreckBuilding = _objType in DZE_isWreckBuilding;
_isMine = _objType in ["Land_iron_vein_wreck","Land_silver_vein_wreck","Land_gold_vein_wreck"];
_isModular = _obj isKindOf "ModularItems";
 
_limit = 3;
if (DZE_StaticConstructionCount > 0) then {
_limit = DZE_StaticConstructionCount;
}
else {
if (isNumber (configFile >> "CfgVehicles" >> _objType >> "constructioncount")) then {
_limit = getNumber(configFile >> "CfgVehicles" >> _objType >> "constructioncount");
};
};
 
_findNearestPoles = nearestObjects[player, ["Plastic_Pole_EP1_DZ"], 30];
_findNearestPole = [];
{if (alive _x) then {_findNearestPole set [(count _findNearestPole),_x];};} count _findNearestPoles;
 
_IsNearPlot = count (_findNearestPole);
 
if(_IsNearPlot >= 1) then {
 
_nearestPole = _findNearestPole select 0;
 
// Find owner
_ownerID = _nearestPole getVariable["CharacterID","0"];
 
// check if friendly to owner
if(dayz_characterID != _ownerID) then {
_friendlies = _nearestPole getVariable ["plotfriends",[]];
_fuid  = [];
{
_friendUID = _x select 0;
_fuid  =  _fuid  + [_friendUID];
} forEach _friendlies;
_builder  = getPlayerUID player;
// check if friendly to owner
if(_builder in _fuid) then {
_canBuildOnPlot = true;
};
 
};
};
 
_nameVehicle = getText(configFile >> "CfgVehicles" >> _objType >> "displayName");
 
cutText [format[(localize "str_epoch_player_162"),_nameVehicle], "PLAIN DOWN"];
 
if (_isModular) then {
     //allow previous cutText to show, then show this if modular.
     cutText [(localize "STR_EPOCH_ACTIONS_21"), "PLAIN DOWN"];
};
 
// Alert zombies once.
[player,50,true,(getPosATL player)] spawn player_alertZombies;
 
_brokenTool = false;
 
// Start de-construction loop
_counter = 0;
while {_isOk} do {
 
// if object no longer exits this should return true.
if(isNull(_obj)) exitWith {
_isOk = false;
_proceed = false;
};
[1,1] call dayz_HungerThirst;
player playActionNow "Medic";
_dis=20;
[player,_dis,true,(getPosATL player)] spawn player_alertZombies;
 
r_interrupt = false;
_animState = animationState player;
r_doLoop = true;
_started = false;
_finished = false;
 
while {r_doLoop} do {
_animState = animationState player;
_isMedic = ["medic",_animState] call fnc_inString;
if (_isMedic) then {
_started = true;
};
if (_started && !_isMedic) then {
r_doLoop = false;
_finished = true;
_sfx = "repair";
[player,_sfx,0,false,_dis] call dayz_zombieSpeak;
};
if (r_interrupt) then {
r_doLoop = false;
};
 
sleep 0.1;
 
};
 
if(!_finished) exitWith {
_isOk = false;
_proceed = false;
};
 
if(_finished) then {
_counter = _counter + 1;
// 10% chance to break a required tool each pass
if((_isDestructable || _isRemovable) && !_isOwnerOfObj) then {
if((random 10) <= 1) then {
_brokenTool = true;
};
};
};
if(_brokenTool) exitWith {
_isOk = false;
_proceed = false;
};
 
cutText [format[(localize "str_epoch_player_163"), _nameVehicle, _counter,_limit], "PLAIN DOWN"];
 
if(_counter == _limit) exitWith {
_isOk = false;
_proceed = true;
};
 
};
 
 
 
if(_brokenTool) then {
if(_isWreck) then {
_removeTool = "ItemToolbox";
} else {
_removeTool = ["ItemCrowbar","ItemToolbox"] call BIS_fnc_selectRandom;
};
if(([player,_removeTool,1] call BIS_fnc_invRemove) > 0) then {
cutText [format[(localize "str_epoch_player_164"),getText(configFile >> "CfgWeapons" >> _removeTool >> "displayName"),_nameVehicle], "PLAIN DOWN"];
};
};
 
// Remove only if player waited
if (_proceed) then {
 
// Double check that object is not null
if(!isNull(_obj)) then {
 
_ipos = getPosATL _obj;
 
deleteVehicle _obj;
 
if(!_isWreck) then {
PVDZE_obj_Delete = [_objectID,_objectUID,_activatingPlayer];
publicVariableServer "PVDZE_obj_Delete";
};
 
cutText [format[(localize "str_epoch_player_165"),_nameVehicle], "PLAIN DOWN"];
 
_preventRefund = false;
 
_selectedRemoveOutput = [];
if(_isWreck) then {
// Find one random part to give back
_refundpart = ["PartEngine","PartGeneric","PartFueltank","PartWheel","PartGlass","ItemJerrycan"] call BIS_fnc_selectRandom;
_selectedRemoveOutput set [count _selectedRemoveOutput,[_refundpart,1]];
} else {
if(_isWreckBuilding) then {
_selectedRemoveOutput = getArray (configFile >> "CfgVehicles" >> _objType >> "removeoutput");
} else {
_selectedRemoveOutput = getArray (configFile >> "CfgVehicles" >> _objType >> "removeoutput");
_preventRefund = (_objectID == "0" && _objectUID == "0");
 
};
};
 
if((count _selectedRemoveOutput) <= 0) then {
cutText [(localize "str_epoch_player_90"), "PLAIN DOWN"];
};
 
if (_ipos select 2 < 0) then {
_ipos set [2,0];
};
 
_radius = 1;
 
if (_isMine) then {
if((random 10) <= 4) then {
_gems = ["ItemTopaz","ItemObsidian","ItemSapphire","ItemAmethyst","ItemEmerald","ItemCitrine","ItemRuby"];
_gem = _gems select (floor(random (count _gems)));
_selectedRemoveOutput set [(count _selectedRemoveOutput),[_gem,1]];
};
};
 
// give refund items
if((count _selectedRemoveOutput) > 0 && !_preventRefund) then {
_item = createVehicle ["WeaponHolder", _iPos, [], _radius, "CAN_COLLIDE"];
{
_itemOut = _x select 0;
_countOut = _x select 1;
if (typeName _countOut == "ARRAY") then {
_countOut = round((random (_countOut select 1)) + (_countOut select 0));
};
_item addMagazineCargoGlobal [_itemOut,_countOut];
} count _selectedRemoveOutput;
 
_item setposATL _iPos;
 
player reveal _item;
 
player action ["Gear", _item];
};
} else {
cutText [(localize "str_epoch_player_91"), "PLAIN DOWN"];
};
 
} else {
r_interrupt = false;
if (vehicle player == player) then {
[objNull, player, rSwitchMove,""] call RE;
player playActionNow "stop";
};
};
DZE_ActionInProgress = false;
s_player_deleteBuild = -1;

 

 

actually my players also started complaining about not being able to remove stuff also, so i went through the code in fn_selfactions and edited a bit for non-plot for life users.

this requires my previous fix for removing owners from the plot to work proper.

 

after adding the other fix replace the code for removal in fn_selfactions with this:

///Allow owners to delete modulars
		if(_isModular || _isModularDoor || _typeOfCursorTarget in dayz_allowedObjects) then {
			if(_hasToolbox && "ItemCrowbar" in _itemsPlayer) then {
				_friendsallowedremove = false; // allow friendlies added to the pole to remove
				_adminList = ["0123456789","0123456789"]; // Add admins here
				_findNearestPoles = nearestObjects[player, ["Plastic_Pole_EP1_DZ"], DZE_PlotPole select 1];
				_IsNearPlot = count (_findNearestPoles);
				_fuid  = [];
				_allowed = [];
				if(_IsNearPlot > 0)then{
					_thePlot = _findNearestPoles select 0;
					_friends = _thePlot getVariable ["plotfriends", []];
					if(_friendsallowedremove)then{
						{
						  _friendUID = _x select 0;
						  _fuid  =  _fuid  + [_friendUID];
						} count _friends;
					}else{
						_fuid = [(_friends select 0)select 0];
					};
					if(dayz_characterID == _ownerID || (getPlayerUID player) in (_adminList + _fuid))then{  // // If u want that the object also belongs to someone on the plotpole.
						_player_deleteBuild = true;
					};
				}else{
					if(dayz_characterID == _ownerID || (getPlayerUID player) in _adminList)then{
						_player_deleteBuild = true;
					};
				};                                        
			};
		};

i added so players can remove anything from dayz_allowedObjects, if you have something in there thats not a building you might want to change that.

 

edit:

it is advised to increase plot pole area size so other players can not move in on other players base and remove it, i also added my plotpole as indestructable object to make sure other players cant just destroy that and place their own next restart.

Link to comment
Share on other sites

Can't you let the server owner decide, which Objects will be counted in count Objects? For me (more the guy i work for and he's awesome) i prefer, that the Object Counter only get's Modular Items, like so:

 

_count = count ((getPosATL player) nearObjects ["ModularItems",_range]);

While others want to limit the Player Base sizes in cities etc, they want all Objects:

 

_count = count ((getPosATL player) nearObjects ["All",_range]);

Which includes object's like the Grascutter, which is pretty much invisible..

Setting up an array 

_ObjectsToCount = ["ModularItems","BuiltItems"]; //ModularItems and BuildItems

because they do not include gras cutters or signs. Would be much more user friendly, as it gives you the option to set up your own counter (kind of). If the houses in cities should be counted to that would be DZE_Housebase (not sure). Since something like this wouldn't work:
 

_count = count ((getPosATL player) nearObjects ["ModularItems","BuildItems",_range]);

a work around for that would be to count the array size and count the objects inside foreach. (i guess? I'm not a pro, just trying to explain what i thought about)

 

 

// Maybe give the user an Option to Upgrade his Plot to "pro".. In that case only modularItems would be counted, so the player has more "space" (?) to build.

Link to comment
Share on other sites

Just added plot management 2.1 maintain version with the dome NON plot4life version and I am getting errors, Could I please get some help with this?

 

Below Is what's happening after installing this. Dome does not work and neither does Maintain :S

 

Running Overpoch / Origins Taviana

 

20:02:11 Warning Message: No entry 'bin\config.bin/CfgWeapons.'.
20:02:11 Warning Message: No entry '.scope'.
20:02:11 Warning Message: '/' is not a value
20:02:11 Warning Message: Error: creating weapon  with scope=private
20:02:11 Warning Message: No entry '.displayName'.
20:02:11 Warning Message: '/' is not a value
20:02:11 Warning Message: No entry '.nameSound'.
20:02:11 Warning Message: '/' is not a value
20:02:11 Warning Message: No entry '.type'.
20:02:11 Warning Message: '/' is not a value
20:02:11 Warning Message: No entry '.picture'.
20:02:11 Warning Message: '/' is not a value
20:02:11 Warning Message: No entry '.Library'.
20:02:11 Warning Message: No entry '.libTextDesc'.
20:02:11 Warning Message: '/' is not a value
20:02:11 Warning Message: No entry '.model'.
20:02:11 Warning Message: '/' is not a value
20:02:11 Warning Message: No entry '.simulation'.
20:02:11 Warning Message: '/' is not a value
20:02:11 Warning Message: No entry '.fireLightDuration'.
20:02:11 Warning Message: '/' is not a value
20:02:11 Warning Message: No entry '.fireLightIntensity'.
20:02:11 Warning Message: '/' is not a value
20:02:11 Warning Message: No entry '.weaponLockDelay'.
20:02:11 Warning Message: '/' is not a value
20:02:11 Warning Message: No entry '.weaponLockSystem'.
20:02:11 Warning Message: '/' is not a value
20:02:11 Warning Message: No entry '.cmImmunity'.
20:02:11 Warning Message: '/' is not a value
20:02:11 Warning Message: No entry '.lockingTargetSound'.
20:02:11 Warning Message: Size: '/' not an array
20:02:11 Warning Message: No entry '.lockedTargetSound'.
20:02:11 Warning Message: Size: '/' not an array
20:02:11 Warning Message: No entry '.muzzles'.
20:02:11 Warning Message: Size: '/' not an array
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...