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 :)
Question
joelash
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):
Current server_maintainArea.sqf
If there are any newer versions of this file fixing this issue, please respond :)
Link to comment
Share on other sites
2 answers to this question
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now