Jump to content

[Release] 3.0 Door Management - No More Codes


Zupa

Recommended Posts

can someone help me? I have installed plotmanagement and doormanagement and p4l

When i upgrade door with combination lock at client side i see this errors:

Spoiler

Error in expression <VDZE_veh_Update";
PVDZE_veh_Update call server_updateObject;

_friendUID = getPl>
  Error position: <server_updateObject;

_friendUID = getPl>
  Error Undefined variable in expression: server_updateobject
File mpmissions\__CUR_MP.Napf\Custom\A_Plot_for_Life\Action\player_upgrade.sqf, line 172
Error in expression <VDZE_veh_Update";
PVDZE_veh_Update call server_updateObject;

_friendUID = getPl>
  Error position: <server_updateObject;

_friendUID = getPl>
  Error Undefined variable in expression: server_updateobject
File mpmissions\__CUR_MP.Napf\Custom\A_Plot_for_Life\Action\player_upgrade.sqf, line 172

I can manage door, it show mee online people and door friends and i'm a friend of this door. But when i try to unlock it with eye scan nothing happen and when i try again i receive message that doors is allready opening.

After restart i try to manage door and at client side i see this error:

Spoiler

Error in expression <"doorfriends",[]];
{
if ((_x  select 0) == (getPlayerUID player)) then{ _canOpen>
  Error position: <== (getPlayerUID player)) then{ _canOpen>
  Error ==: Type Array, expected Number,String,Object,Side,Group,Text,Config entry,Display (dialog),Control,Team member,Task,Location
File mpmissions\__CUR_MP.Napf\doorManagement\initDoorManagement.sqf, line 13

When i try open door i see this at client side:

Spoiler

Error in expression <;
};
_allowed = [];
{
_friendUID = _x select 0;
_allowed  =  _allowed  + [_fri>
  Error position: <select 0;
_allowed  =  _allowed  + [_fri>
  Error select: Type Number, expected Array,Config entry
File mpmissions\__CUR_MP.Napf\doorManagement\player_unlockDoor.sqf, line 24
Error in expression <;
};
_allowed = [];
{
_friendUID = _x select 0;
_allowed  =  _allowed  + [_fri>
  Error position: <select 0;
_allowed  =  _allowed  + [_fri>
  Error Generic error in expression
File mpmissions\__CUR_MP.Napf\doorManagement\player_unlockDoor.sqf, line 24

and this at server side:

Spoiler

 3:39:03 "infiSTAR.de Log: DOOR UNLOCK ATTEMPT: ID:654 UID:0 BY habahaba(76561198071372372) @154109 Code Entered: 000 | Correct Code: 733"

 

EDIT1: I have removed one thing that i have addet. It's at first post and it's only for non p4l users. now i do not have errors when build doors and upgrade them. But i do not able to manage dor after restart and unable to open door not before restart not after restart.

I found that inventory of doors at database is empty. So that mean that problem stored at server_updateObject.sqf inside _object_inventory = { Here is my part of that file:

Spoiler

_object_inventory = {
    private["_inventory","_previous","_key"];
        _isNormal = true;
        if (typeOf (_object) == "Plastic_Pole_EP1_DZ") then{
            _isNormal = false;
            _inventory = _object getVariable ["plotfriends", []]; //We're replacing the inventory with UIDs for this item
        };
        if (typeOf (_object)in DZE_DoorsLocked) then{
            _isNormal = false;
            _inventory = _object getVariable ["doorfriends", []]; //We're replacing the inventory with UIDs for this item
        };

        if(_isNormal)then {
            _inventory = [
            getWeaponCargo _object,
            getMagazineCargo _object,
            getBackpackCargo _object,
            /*ZSC*/
            _object getVariable["bankMoney",0]
            /*ZSC*/
        ];
        };
        _previous = str(_object getVariable["lastInventory",[]]);
        if (str(_inventory) != _previous) then {
            _object setVariable["lastInventory",_inventory];
            if (_objectID == "0") then {
                _key = format["CHILD:309:%1:%2:",_uid,_inventory];
            } else {
                _key = format["CHILD:303:%1:%2:",_objectID,_inventory];
            };
            //diag_log ("HIVE: WRITE: "+ str(_key));
            _key call server_hiveWrite;
        };
};

EDIT2: I have added _object setVariable ["ownerPUID", _ownerPUID, true];  to my server_monitor.sqf file. Problem is here. :( When object (pole or door) created inventory show as [], when i add someone to pole or to the door oject invetrory become [[[],[]],[[],[]],[[],[]],0]

So as i can see plot and door do not put ID's to the database.

EDIT3: Yes, i continue my scary storry my friends. I have solved problem with database store. I found taht i have duplicate of my lovely server_updateObject.sqf. I removed dublicate (diffet before remove to check what file i need) and now when i add people to plot or door friend they add to database.

But i found other problem. When owner build door or plot owner do not stored at database at plot friends. I do not know is it normal (cause p4l is installed) so if someone give me a light on it i will appresiate it.

Link to comment
Share on other sites

  • 5 weeks later...
  • 5 weeks later...

Hey guys,

 

I installed this on my server, works great, I applied the fixes that ebaydayz and Proximus (I think?) suggested for automatically adding people to the door on upgrade and removing on downgrade for non plot for life users.

The downgrade works perfectly every time and the users are removed from the door in the mysql database, but when upgraded again SOMETIMES it publishes to the database and others it doesn't.

I did a test of 4 cinder garage doors and 4 cinder small doors, 3/8 published to the database, all 8 I am in door friends which I am guessing on 5 of those I will lose access to on restart. I got a friend to test with me and I added him to the same doors, all 8 published to the database when manually added via Manage Door. I then removed him from all 8 doors again and once again it published the changes to the database. So the problem seems isolated to the automatic upgrading.

This is the code im using in my player_upgrade.sqf:

			_friendUID = getPlayerUID player;
			_friendName = name  player;
			_friends = [[_friendUID,_friendName]] ; 

			_object setVariable ["doorfriends", _friends, true];
			PVDZE_veh_Update = [_object,"gear"];
			publicVariableServer "PVDZE_veh_Update";
			if (isServer) then {
				PVDZE_veh_Update call server_updateObject;
			};

This is the code im using in player_buildingdowngrade.sqf:

 

			_obj setVariable ["doorfriends",[],true];
			PVDZE_veh_Update = [_obj,"gear"];
			publicVariableServer "PVDZE_veh_Update";

There are no client or server side errors in either RPT.

My next step is to add a lot of debug lines to see what is going on

Any suggestions?

 

Cheers.

Link to comment
Share on other sites

  • 3 months later...
On 4/4/2015 at 8:16 PM, GudrunGisela said:

I've got the same problem like SteamROLLER. I thought this additional line:"IMPORTANT FOR NON PLOT4 LIFE USERS" means that this script works now without P4L. I have no notion of installing P4L because I think this is a unnecessary complicated Script. Other more easier scripts do have the same impact and are much more compatible with modded servers. Anyway I've installed ZSC 3.0, PlotManagement and Advanced Trading and they all work fine (Many Thanks Zupa). Only doorManagement rebels persistent. If you upgrade a door with a code lock you're not the owner of this. I hope anyone find a solution for this. Many Thanks!

 

Best regards,

 

GudrunGisela

I'm having this issue currently, I don't have Plot4Life and I tried doing the non-plot4life fix at the bottom of the instructions but after restart I'm no longer the owner of any locked doors I've placed and the only way I can fix it is by removing and placing the lock down again. I don't have any errors in my log file so I'm not sure where the issue could be coming from. Has anyone managed to get door management to work without using plot4life?

Link to comment
Share on other sites

This mod doesn't actually automatically add you to locked doors or remove you when you downgrade them. You have to add that manually, there are steps inside this thread on how to do it.

 

There is information that Zupa has linked from a user on the first post at the end of it on how to add the user to the door automatically:

On 9/16/2014 at 4:26 AM, joelash said:

To add the owner as default to the doors on placement, edit your Player_Upgrade.sqf
 
Locate this:

player reveal _object;
Paste the following code underneath:
 
_friendUID = getPlayerUID player;
_friendName = name  player;
_friends = [[_friendUID,_friendName]] ; 


_object setVariable ["doorfriends", _friends, true];
PVDZE_veh_Update = [_object,"gear"];
publicVariableServer "PVDZE_veh_Update";
PVDZE_veh_Update call server_updateObject;

 

Link to comment
Share on other sites

7 hours ago, salival said:

This mod doesn't actually automatically add you to locked doors or remove you when you downgrade them. You have to add that manually, there are steps inside this thread on how to do it.

There is information that Zupa has linked from a user on the first post at the end of it on how to add the user to the door automatically:

To add the owner as default to the doors on placement, edit your Player_Upgrade.sqf

 

I figured out what the issue was:

* At step 6 when editing server_updateObject.sqf make sure you are editing the appropriate section relating to whether you have plot management installed - I had plot management installed and followed the instructions for not having it installed.

* Also at step 6, make sure you place a comma after "get_BackpackCargo _object" IF you are using ZSC. So it should look like this: "get_BackpackCargo _object," - so this is how that whole section in step 6 looked for me as a player that has plot management and zupa single coin but not plot4life:

Quote

_object_inventory = {
    private["_inventory","_previous","_key"];
_isNormal = true;
if (typeOf (_object) == "Plastic_Pole_EP1_DZ") then{
    _isNormal = false;
    _inventory = _object getVariable ["plotfriends", []]; //We're replacing the inventory with UIDs for this item
};
if (typeOf (_object)in DZE_DoorsLocked) then{
    _isNormal = false;
    _inventory = _object getVariable ["doorfriends", []]; //We're replacing the inventory with UIDs for this item
};
if(_isNormal)then {
    _inventory = [
    getWeaponCargo _object,
    getMagazineCargo _object,
    getBackpackCargo _object,
    /*ZSC*/
    _object getVariable["bankMoney",0]
    /*ZSC*/
];
};

 

Link to comment
Share on other sites

  • 3 months later...

If the user choose to manually enter the code, the lock interface doesn't do anything. If you click the numbers they don't rotate or click and you can't enter a number.  I've noticed someone else has this issue too.  Is there a fix for it?  For now I have disable the option for manual code entering.

 

 

Link to comment
Share on other sites

  • 2 weeks later...
On 9/11/2014 at 2:07 AM, Zupa said:

 

IMPORTANT FOR NON PLOT 4 LIFE USERS

To add the owner as default to the doors on placement, edit your Player_Upgrade.sqf
 
Locate this:


player reveal _object;

Paste the following code underneath:

 

 


_friendUID = getPlayerUID player;
_friendName = name  player;
_friends = [[_friendUID,_friendName]] ; 


_object setVariable ["doorfriends", _friends, true];
PVDZE_veh_Update = [_object,"gear"];
publicVariableServer "PVDZE_veh_Update";
PVDZE_veh_Update call server_updateObject;

 Is this still needing to be done. I don't have access to my dayz_code so I dont know how i would update this?

Link to comment
Share on other sites

11 hours ago, DAKA said:

 Is this still needing to be done. I don't have access to my dayz_code so I dont know how i would update this?

or create one see:

in your custom fn_Selfactions.sqf you have the call for player_upgrade.sqf

if (s_player_upgrade_build < 0) then {
			// s_player_lastTarget = _cursorTarget;
			s_player_lastTarget set [0,_cursorTarget];
			s_player_upgrade_build = player addAction [format[localize "STR_EPOCH_ACTIONS_UPGRADE",_text], "\z\addons\dayz_code\actions\player_upgrade.sqf",_cursorTarget, -1, false, true, "",""];
		};

so change by:

if (s_player_upgrade_build < 0) then {
			// s_player_lastTarget = _cursorTarget;
			s_player_lastTarget set [0,_cursorTarget];
			s_player_upgrade_build = player addAction [format[localize "STR_EPOCH_ACTIONS_UPGRADE",_text], "custom\player_upgrade.sqf",_cursorTarget, -1, false, true, "",""];
		};
	

 

now player_upgrade.sqf must be into Mpmissions\your instance\custom\

Spoiler

/*
    DayZ Base Building Upgrades
    Made for DayZ Epoch please ask permission to use/edit/distrubute email [email protected].
*/
private ["_location","_dir","_classname","_missing","_text","_proceed","_num_removed","_object","_missingQty","_itemIn","_countIn","_qty","_removed","_removed_total","_tobe_removed_total","_objectID","_objectUID","_temp_removed_array","_textMissing","_newclassname","_requirements","_obj","_upgrade","_lockable","_combination_1","_combination_2","_combination_3","_combination","_objectCharacterID","_canBuildOnPlot","_friendlies","_nearestPole","_ownerID","_distance","_needText","_findNearestPoles","_findNearestPole","_IsNearPlot"];

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

player removeAction s_player_upgrade_build;
s_player_upgrade_build = 1;


_distance = 30;
_needText = localize "str_epoch_player_246";

// check for near plot
_findNearestPoles = nearestObjects [(vehicle player), ["Plastic_Pole_EP1_DZ"], _distance];
_findNearestPole = [];

{
    if (alive _x) then {
        _findNearestPole set [(count _findNearestPole),_x];
    };
} count _findNearestPoles;

_IsNearPlot = count (_findNearestPole);

_canBuildOnPlot = false;

if(_IsNearPlot == 0) then {
    _canBuildOnPlot = true;
} else {
    
    // check nearby plots ownership && then for friend status
    _nearestPole = _findNearestPole select 0;

    // Find owner
    _ownerID = _nearestPole getVariable["CharacterID","0"];

    // diag_log format["DEBUG BUILDING: %1 = %2", dayz_characterID, _ownerID];

    // check if friendly to owner
    if(dayz_characterID == _ownerID) then {
        _canBuildOnPlot = true;        
    } else {
        _friendlies        = player getVariable ["friendlyTo",[]];
        // check if friendly to owner
        if(_ownerID in _friendlies) then {
            _canBuildOnPlot = true;
        };
    };
};

// exit if not allowed due to plot pole
if(!_canBuildOnPlot) exitWith {  DZE_ActionInProgress = false; cutText [format[(localize "str_epoch_player_157"),_needText,_distance] , "PLAIN DOWN"]; };

// get cursortarget from addaction
_obj = _this select 3;

// Find objectID
_objectID     = _obj getVariable ["ObjectID","0"];

// Find objectUID
_objectUID    = _obj getVariable ["ObjectUID","0"];

if(_objectID == "0" && _objectUID == "0") exitWith {DZE_ActionInProgress = false; s_player_upgrade_build = -1; cutText [(localize "str_epoch_player_50"), "PLAIN DOWN"];};

// Get classname
_classname = typeOf _obj;

// Find display name
_text = getText (configFile >> "CfgVehicles" >> _classname >> "displayName");

// Find next upgrade
_upgrade = getArray (configFile >> "CfgVehicles" >> _classname >> "upgradeBuilding");

if ((count _upgrade) > 0) then {

    _newclassname = _upgrade select 0;

    _lockable = 0;
    if(isNumber (configFile >> "CfgVehicles" >> _newclassname >> "lockable")) then {
        _lockable = getNumber(configFile >> "CfgVehicles" >> _newclassname >> "lockable");
    };

    _requirements = _upgrade select 1;
    
    _missingQty = 0;
    _missing = "";
    
    _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 {
        [1,1] call dayz_HungerThirst;
        player playActionNow "Medic";
        [player,20,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;
            // diag_log format["Recipe Finish: %1 %2", _itemIn,_countIn];
            _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 parts removed proceed
        if (_tobe_removed_total == _removed_total) then {
            
            // Get position
            _location    = _obj getVariable["OEMPos",(getposATL _obj)];

            // Get direction
            _dir = getDir _obj;

            // Current charID
            _objectCharacterID     = _obj getVariable ["CharacterID","0"];

            _classname = _newclassname;
            
            // Create new object
            _object = createVehicle [_classname, [0,0,0], [], 0, "CAN_COLLIDE"];

            // Set direction
            _object setDir _dir;

            // Set location
            _object setPosATL _location;

            if (_lockable == 3) then {

                _combination_1 = floor(random 10);
                _combination_2 = floor(random 10);
                _combination_3 = floor(random 10);
                _combination = format["%1%2%3",_combination_1,_combination_2,_combination_3];
                
                _objectCharacterID = _combination;
                
                cutText [format[(localize "str_epoch_player_158"),_combination,_text], "PLAIN DOWN", 5];
            } else {    
                cutText [format[(localize "str_epoch_player_159"),_text], "PLAIN DOWN", 5];
            };

            PVDZE_obj_Swap = [_objectCharacterID,_object,[_dir,_location],_classname,_obj,player];
            publicVariableServer "PVDZE_obj_Swap";

            player reveal _object;
            
_friendUID = getPlayerUID player;
_friendName = name  player;
_friends = [[_friendUID,_friendName]] ;


_object setVariable ["doorfriends", _friends, true];
PVDZE_veh_Update = [_object,"gear"];
publicVariableServer "PVDZE_veh_Update";
PVDZE_veh_Update call server_updateObject;

            
        } else {
        
            {player addMagazine _x;} count _temp_removed_array;
            cutText [format[(localize "str_epoch_player_145"),_removed_total,_tobe_removed_total], "PLAIN DOWN"];
        
        };
    } else {
        _textMissing = getText(configFile >> "CfgMagazines" >> _missing >> "displayName");
        cutText [format[(localize "str_epoch_player_146"),_missingQty, _textMissing], "PLAIN DOWN"];
    };

} else {
    cutText [(localize "str_epoch_player_82"), "PLAIN DOWN"];
};

DZE_ActionInProgress = false;
s_player_upgrade_build = -1;

or just made it as bigegg says.

Link to comment
Share on other sites

Just a headsup.

Epoch will update today to 1.0.6 

[NEW] A much improved version of Zupa's Advanced Trading 2.1+ is now the default config trader menu, NOT COMPATIBLE WITH DATABASE TRADERS @icomrade @Windmolders 
[NEW] A Plot For Life v2.5+ by RimBlock is now included and enabled by default, see configVariables.sqf @RimBlock @icomrade
[NEW] Build Vectors v4+ by Striker is now included, only enabled with Snap building. Note there is no option to turn off Vector Building with Snap Building enabled @strikerforce @icomrade
[NEW] Door Management v3.0+ by Zupa is now included and enabled by default with variable DZE_doorManagement, see configVariables.sqf @DevZupa @Bruce-LXXVI @ebayShopper 
[NEW] Plot Management v2.1+ by Zupa is now included and enabled by default with variable DZE_permanentPlot, see configVariables.sqf @DevZupa @Bruce-LXXVI @icomrade
Link to comment
Share on other sites

  • 3 weeks later...

b - Place the following:

//Allow manage door
if((_typeOfCursorTarget in DZE_DoorsLocked)) then {
	if (s_player_manageDoor < 0) then {		 
     s_player_manageDoor = player addAction ["<t color='#0059FF'>Manage Door</t>", "doorManagement\initDoorManagement.sqf", _cursorTarget, 5, false];
	};
} else {
		player removeAction s_player_manageDoor;
		s_player_manageDoor = -1;
};

above

//Allow owner to unlock vault

I don't have the //Allow owner to unlock vault, anywhere even if i search for the words saparat

 

could some one give me a copy to the fn_selfactions file so i can find the line thank you

Link to comment
Share on other sites

@Brody  

find:

if((_typeOfCursorTarget in DZE_LockableStorage) && _ownerID != "0" && (player distance _cursorTarget < 3)) then {

above past:

//Allow manage door
if((_typeOfCursorTarget in DZE_DoorsLocked)) then {
	if (s_player_manageDoor < 0) then {		 
     s_player_manageDoor = player addAction ["<t color='#0059FF'>Manage Door</t>", "doorManagement\initDoorManagement.sqf", _cursorTarget, 5, false];
	};
} else {
		player removeAction s_player_manageDoor;
		s_player_manageDoor = -1;
};

 

also check your inbox, i send  a msg with a full tuto for your files.

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...