Jump to content

joelash

Member
  • Posts

    8
  • Joined

  • Last visited

Posts posted by joelash

  1. Hey guys, if you're using the latest v2.0.2 and DoorManagement follow the instructions below, else when changing codes all players will be removed from the management.

     

    Replace ckc_upddoor.sqf's contents with:

    private ["_vector","_object","_newCombo","_actual","_ownerPUID","_location","_classname","_newobject"];
    _object = dayz_selectedDoor;
    _newCombo = DZE_Lock_Door;
    _object setVariable ["CharacterID",_newCombo,true];
    _actual = _object getVariable ["CharacterID", "0"];
    _ownerPUID = _object getVariable["OwnerPUID",""];
    _friends = _object getVariable["doorfriends",[]];
    cutText [format["Your new ComboKey:  %1", _actual], "PLAIN DOWN"];
    _classname = typeOf _object;
    _location	= _object getVariable["OEMPos",(getposATL _object)];
    _vector = [(vectorDir _object), (vectorUp _object)];
    _dir = getDir _object;
    
    // Create new object 
    _newobject = createVehicle [_classname, [0,0,0], [], 0, "CAN_COLLIDE"];
    
    // Set location
    _newobject setPosATL _location;
    
    // Set orientation
    _newobject setVectorDirAndUp _vector;
    
    if (_ownerPUID != "") then {
    	_newobject setVariable["OwnerPUID",_ownerPUID,true];
    	if ((_vector select 1) select 0 == 0 && (_vector select 1) select 1 == 0 && (_vector select 1) select 2 == 1) then {
    		PVDZE_obj_Swap = [_actual,_newobject,[_dir,_location,_ownerPUID],_classname,_object,player];
    	} else {
    		PVDZE_obj_Swap = [_actual,_newobject,[_dir,_location,_ownerPUID,_vector],_classname,_object,player];
    	};
    } else {
    	_newobject setVariable ["doorfriends", _friends, true];
    	if ((_vector select 1) select 0 == 0 && (_vector select 1) select 1 == 0 && (_vector select 1) select 2 == 1) then {
    		PVDZE_obj_Swap = [_actual,_newobject,[_dir,_location],_classname,_object,player];
    	} else {
    		PVDZE_obj_Swap = [_actual,_newobject,[_dir,_location,_vector],_classname,_object,player];
    	};
    };
    publicVariableServer "PVDZE_obj_Swap";
    
    PVDZE_veh_Update = [_newobject,"gear"];
    publicVariableServer "PVDZE_veh_Update";
    PVDZE_veh_Update call server_updateObject;
    
    player reveal _newobject;
    dayz_selectedDoor = _newobject;
    
    if (count (dayz_selectedDoor getVariable["doorfriends",[]]) > 0) exitWith {} else {
    	_friends = dayz_selectedDoor setVariable ["doorfriends",_friends,true];
    };
    

    This gets the current doorfriends, and assigns it to the new object.

     

    I'm sure this can be easily changes for the earlier version.

  2. Hey Guys,

     

    Not sure why, but when i maintain at a plotpole, its takes the full amount, however only maintains a single item. I have to maintain for each item, being charges the full amount each time. not sure if this is something which i've done :/

     

    I'm using the Single Currency version of PM.

    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 * 100;
    _requirements = [[CurrencyName,_theCost]];
    
    
    _option = _this select 0;
    switch _option do {
    	case "maintain": {
    		
    		_wealth = player getVariable["headshots",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["headshots",_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;
    
  3. Hey everyone, im currently getting my server working 100% but this is the only thing currently holding it back. I have an SQL event updating the Damage Value of the objects every 3 days, and so it should be maintained when this occurs. However when maintaining an object this isnt updated in the DB and the Damage Value stays the same and the DateStamp/LastUpdated aren't refreshed.

     

    Any help on this Would be greatly appreciated.

     

    RPT Log of Maintain (No Errors Shown):

    17:16:14 "MAINTAIN AREA BY Joel - 10 Objects at [2314.19,15331.1,0.00195313]"

    Current server_maintainArea.sqf

    /* 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;
    			
    		};
    	};
    };
    

    If there are any newer versions of this file fixing this issue, please respond :)

  4. 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;

    This can be cleaned and i'm looking forward to your complete version Zupa :)

  5. Hi All,

     

    I've been playing with this for the last few hours. My coding knowledge isn't so good, but i've got this to work now without Plot4Life. To get this working do the following :)

     

    In Player_Upgrade find "if (_lockable == 3) then {" and change it to look like the below;

     

    if (_lockable == 3) then {
    _combination = dayz_characterID;
    _objectCharacterID = _combination;
    //cutText [format[(localize "str_epoch_player_158"),_combination,_text], "PLAIN DOWN", 5];
     
    Once you have done that change your InitDoorManagement.sqf to look like the following;
     
    disableSerialization;
    if(count(_this) > 0)then{
    TheDoor = _this select 3;
    }else{
    TheDoor = dayz_selectedDoor;
    };
    _display = findDisplay 41144;
    _display closeDisplay 3000;
    _cursorTarget = cursorTarget;
    _friends = TheDoor getVariable ["doorfriends",[]];
    _owner = _cursorTarget getVariable ["CharacterID","0"];
     
    _adminList = [""]; // Add admins here if you admins to able to manage all plotpoles
    _allowed = _adminList + _friends;
     
    if(_owner == dayz_characterID || (getPlayerUID player) in _allowed)then{  
    createDialog "DoorManagement";
    call DoorNearbyHumans;
    call DoorGetFriends;
    }else{
    cutText ["You do not have the rights to manage.","PLAIN DOWN"];
    };
     
    This is working for me know without any errors :) just make sure to add yourself to the door before you die.
     
    Good luck.

     

  6. If you are not using Plot4Life, replace your InitDoorManagement.sqf with the following;

     

     

    disableSerialization;
    if(count(_this) > 0)then{
    TheDoor = _this select 3;
    }else{
    TheDoor = dayz_selectedDoor;
    };
    _display = findDisplay 41144;
    _display closeDisplay 3000;
    _friends = TheDoor getVariable ["doorfriends",[]];
     
    _adminList = ["1111111111111"]; // Add admins here if you admins to able to manage all plotpoles
    _owner = TheDoor getVariable ["CharacterID","0"];
    _fuid = [];
    {
    _friendUID = _x select 0;
    _fuid = _fuid + [_friendUID];
    } forEach _friends;
    _allowed = [_owner];    
    _allowed = [_owner] + _adminList + _fuid;
     
    if((getPlayerUID player) in _allowed)then{
    createDialog "DoorManagement";
    call DoorNearbyHumans;
    call DoorGetFriends;
    }else{
    cutText ["You do not have the rights to manage.","PLAIN DOWN"];
    };
     
    This allows the doors to be managed, _allowed code take from PlotManagement. Can probably be tidied.
     
    Have Fun :)
×
×
  • Create New...