SmokeyBR Posted April 7, 2017 Report Share Posted April 7, 2017 ive been trying for the last couple of days adding a safe manager but i cannot make it pass the right format to the database hitpoints field. the files were based on plotmanagement heres the revelant parts Spoiler //vaultaddfriends.sqf private ["_vaults","_inList","_toAdd","_thevault","_friends","_friendUID","_friendName","_userList"]; disableSerialization; _userList = (findDisplay 711198) displayCtrl 7011; _friendUID = _this select 0; _friendName = _userList lbText (lbCurSel _userList); if (_friendUID == "") exitWith {}; _vaults = nearestObjects [[player] call FNC_getPos, [DZE_LockedStorage],15]; _thevault = _vaults select 0; _friends = _thevault getVariable ["vaultFriends",[]]; _toAdd = [_friendUID,toArray _friendName]; _inList = false; { if ((_x select 0) == (_toAdd select 0)) exitWith { _inList = true; }; } count _friends; if (_inList) exitWith { systemChat localize "STR_EPOCH_PLOTMANAGEMENT_ADDFRIEND_ALREADYONTHELIST"; }; if ((count _friends) == DZE_Max_thevaultFriends) exitWith { systemChat format[localize "STR_EPOCH_PLOTMANAGEMENT_ADDFRIEND_FRIENDLIMIT", DZE_Max_thevaultFriends]; }; _friends set [(count _friends), _toAdd]; _thevault setVariable ["vaultFriends", _friends, true]; PVDZ_veh_Save = [_thevault,"damage"]; publicVariableServer "PVDZ_veh_Save"; call PlotGetFriends; call PlotNearbyHumans; server_monitor.sqf Spoiler if( (count _inventory > 0) && !_isPlot && !_doorLocked) then { if (_type in DZE_LockedStorage) then { // Do not send big arrays over network! Only server needs these _object setVariable ["WeaponCargo",(_inventory select 0),false]; _object setVariable ["MagazineCargo",(_inventory select 1),false]; _object setVariable ["BackpackCargo",(_inventory select 2),false]; _object setVariable ["vaultFriends", _hitPoints, true]; } else { _weaponcargo = _inventory select 0 select 0; _magcargo = _inventory select 1 select 0; _backpackcargo = _inventory select 2 select 0; _weaponqty = _inventory select 0 select 1; {_object addWeaponCargoGlobal [_x, _weaponqty select _foreachindex];} foreach _weaponcargo; _magqty = _inventory select 1 select 1; {_object addMagazineCargoGlobal [_x, _magqty select _foreachindex];} foreach _magcargo; _backpackqty = _inventory select 2 select 1; {_object addBackpackCargoGlobal [_x, _backpackqty select _foreachindex];} foreach _backpackcargo; }; } else { if (DZE_permanentPlot && _isPlot) then { _object setVariable ["plotfriends", _inventory, true]; }; if (DZE_doorManagement && _doorLocked) then { _object setVariable ["doorfriends", _inventory, true]; }; if (_vault) then { _object setVariable ["vaultFriends", _hitPoints, true]; }; }; }; server_updateObject.sqf Spoiler _object_damage = { //Allow dmg process private ["_hitpoints","_array","_hit","_selection","_key","_damage","_allFixed"]; if ((typeOf (_object) in DZE_LockedStorage)) then { _damage = damage _object; _array = _object getVariable ["vaultFriends",[]]; _allFixed = false; }; } else { _hitpoints = _object call vehicle_getHitpoints; _damage = damage _object; _array = []; _allFixed = true; { _hit = [_object,_x] call object_getHit; _selection = getText (configFile >> "CfgVehicles" >> (typeOf _object) >> "HitPoints" >> _x >> "name"); if (_hit > 0) then { _allFixed = false; _array set [count _array,[_selection,_hit]]; //diag_log format ["Section Part: %1, Dmg: %2",_selection,_hit]; } else { _array set [count _array,[_selection,0]]; }; } forEach _hitpoints; }; if (_allFixed && !_totalDmg) then {_object setDamage 0;}; if (_forced) then { if (_object in needUpdate_objects) then {needUpdate_objects = needUpdate_objects - [_object];}; _recorddmg = true; } else { //Prevent damage events for the first 10 seconds of the servers live. if (diag_ticktime - _lastUpdate > 10) then { if !(_object in needUpdate_objects) then { //diag_log format["DEBUG: Monitoring: %1",_object]; needUpdate_objects set [count needUpdate_objects, _object]; _recorddmg = true; }; }; }; if (_recorddmg) then { if (_objectID == "0") then { _key = format["CHILD:306:%1:",_objectUID] + str _array + ":" + str _damage + ":"; } else { _key = format["CHILD:306:%1:",_objectID] + str _array + ":" + str _damage + ":"; }; #ifdef OBJECT_DEBUG diag_log ("HIVE: WRITE: "+ str(_key)); #endif _key call server_hiveWrite; }; }; Right now the value im getting into Hitpoints field is [["76561197963145366",[83,109,111,107,101,121]]] Link to comment Share on other sites More sharing options...
0 salival Posted April 7, 2017 Report Share Posted April 7, 2017 9 hours ago, SmokeyBR said: ive been trying for the last couple of days adding a safe manager but i cannot make it pass the right format to the database hitpoints field. the files were based on plotmanagement heres the revelant parts Hide contents //vaultaddfriends.sqf private ["_vaults","_inList","_toAdd","_thevault","_friends","_friendUID","_friendName","_userList"]; disableSerialization; _userList = (findDisplay 711198) displayCtrl 7011; _friendUID = _this select 0; _friendName = _userList lbText (lbCurSel _userList); if (_friendUID == "") exitWith {}; _vaults = nearestObjects [[player] call FNC_getPos, [DZE_LockedStorage],15]; _thevault = _vaults select 0; _friends = _thevault getVariable ["vaultFriends",[]]; _toAdd = [_friendUID,toArray _friendName]; _inList = false; { if ((_x select 0) == (_toAdd select 0)) exitWith { _inList = true; }; } count _friends; if (_inList) exitWith { systemChat localize "STR_EPOCH_PLOTMANAGEMENT_ADDFRIEND_ALREADYONTHELIST"; }; if ((count _friends) == DZE_Max_thevaultFriends) exitWith { systemChat format[localize "STR_EPOCH_PLOTMANAGEMENT_ADDFRIEND_FRIENDLIMIT", DZE_Max_thevaultFriends]; }; _friends set [(count _friends), _toAdd]; _thevault setVariable ["vaultFriends", _friends, true]; PVDZ_veh_Save = [_thevault,"damage"]; publicVariableServer "PVDZ_veh_Save"; call PlotGetFriends; call PlotNearbyHumans; server_monitor.sqf Hide contents if( (count _inventory > 0) && !_isPlot && !_doorLocked) then { if (_type in DZE_LockedStorage) then { // Do not send big arrays over network! Only server needs these _object setVariable ["WeaponCargo",(_inventory select 0),false]; _object setVariable ["MagazineCargo",(_inventory select 1),false]; _object setVariable ["BackpackCargo",(_inventory select 2),false]; _object setVariable ["vaultFriends", _hitPoints, true]; } else { _weaponcargo = _inventory select 0 select 0; _magcargo = _inventory select 1 select 0; _backpackcargo = _inventory select 2 select 0; _weaponqty = _inventory select 0 select 1; {_object addWeaponCargoGlobal [_x, _weaponqty select _foreachindex];} foreach _weaponcargo; _magqty = _inventory select 1 select 1; {_object addMagazineCargoGlobal [_x, _magqty select _foreachindex];} foreach _magcargo; _backpackqty = _inventory select 2 select 1; {_object addBackpackCargoGlobal [_x, _backpackqty select _foreachindex];} foreach _backpackcargo; }; } else { if (DZE_permanentPlot && _isPlot) then { _object setVariable ["plotfriends", _inventory, true]; }; if (DZE_doorManagement && _doorLocked) then { _object setVariable ["doorfriends", _inventory, true]; }; if (_vault) then { _object setVariable ["vaultFriends", _hitPoints, true]; }; }; }; server_updateObject.sqf Hide contents _object_damage = { //Allow dmg process private ["_hitpoints","_array","_hit","_selection","_key","_damage","_allFixed"]; if ((typeOf (_object) in DZE_LockedStorage)) then { _damage = damage _object; _array = _object getVariable ["vaultFriends",[]]; _allFixed = false; }; } else { _hitpoints = _object call vehicle_getHitpoints; _damage = damage _object; _array = []; _allFixed = true; { _hit = [_object,_x] call object_getHit; _selection = getText (configFile >> "CfgVehicles" >> (typeOf _object) >> "HitPoints" >> _x >> "name"); if (_hit > 0) then { _allFixed = false; _array set [count _array,[_selection,_hit]]; //diag_log format ["Section Part: %1, Dmg: %2",_selection,_hit]; } else { _array set [count _array,[_selection,0]]; }; } forEach _hitpoints; }; if (_allFixed && !_totalDmg) then {_object setDamage 0;}; if (_forced) then { if (_object in needUpdate_objects) then {needUpdate_objects = needUpdate_objects - [_object];}; _recorddmg = true; } else { //Prevent damage events for the first 10 seconds of the servers live. if (diag_ticktime - _lastUpdate > 10) then { if !(_object in needUpdate_objects) then { //diag_log format["DEBUG: Monitoring: %1",_object]; needUpdate_objects set [count needUpdate_objects, _object]; _recorddmg = true; }; }; }; if (_recorddmg) then { if (_objectID == "0") then { _key = format["CHILD:306:%1:",_objectUID] + str _array + ":" + str _damage + ":"; } else { _key = format["CHILD:306:%1:",_objectID] + str _array + ":" + str _damage + ":"; }; #ifdef OBJECT_DEBUG diag_log ("HIVE: WRITE: "+ str(_key)); #endif _key call server_hiveWrite; }; }; Right now the value im getting into Hitpoints field is [["76561197963145366",[83,109,111,107,101,121]]] I have not used this mod but that is the correct value for a UID and a name that has been converted to an array (like how plot/door management do it) SmokeyBR 1 Link to comment Share on other sites More sharing options...
0 SmokeyBR Posted April 8, 2017 Author Report Share Posted April 8, 2017 you are right i was expectating playeruid and name inside an array then realized that was the correct format Link to comment Share on other sites More sharing options...
0 Ghostman Posted June 6, 2017 Report Share Posted June 6, 2017 On 8.04.2017 at 0:49 AM, salival said: I have not used this mod but that is the correct value for a UID and a name that has been converted to an array (like how plot/door management do it) i tried install it but Spoiler if (_vault) then { _object setVariable ["vau> 20:23:02 Error position: <_vault) then { _object setVariable ["vau> 20:23:02 Error Undefined variable in expression: _vault 20:23:02 File z\addons\dayz_server\system\server_monitor.sqf, line 268 20:23:02 Error in expression <doorfriends", _inventory, true]; }; Link to comment Share on other sites More sharing options...
0 Hooty Posted June 6, 2017 Report Share Posted June 6, 2017 If you figure it out you will make a lot of players happy. Link to comment Share on other sites More sharing options...
0 DieTanx Posted June 12, 2017 Report Share Posted June 12, 2017 I would love to add this also! Link to comment Share on other sites More sharing options...
0 juandayz Posted June 12, 2017 Report Share Posted June 12, 2017 @Cherdenko are working on this. DieTanx and Cherdenko 2 Link to comment Share on other sites More sharing options...
0 paulinhoajr Posted June 20, 2017 Report Share Posted June 20, 2017 Any news on that? Link to comment Share on other sites More sharing options...
0 Relentless Posted June 20, 2017 Report Share Posted June 20, 2017 On 12.6.2017 at 2:32 AM, juandayz said: @Cherdenko are working on this. I already got that but the files are kinda messed up and not structured. Give me some days to gather all files together and make them clean, then I'll release it. juandayz and DieTanx 2 Link to comment Share on other sites More sharing options...
0 DieTanx Posted July 26, 2017 Report Share Posted July 26, 2017 On 6/20/2017 at 3:52 PM, DAmNRelentless said: I already got that but the files are kinda messed up and not structured. Give me some days to gather all files together and make them clean, then I'll release it. Any update with this? Link to comment Share on other sites More sharing options...
0 khalcifer Posted January 22, 2018 Report Share Posted January 22, 2018 Any changes or something? Link to comment Share on other sites More sharing options...
Question
SmokeyBR
ive been trying for the last couple of days adding a safe manager but i cannot make it pass the right format to the database hitpoints field.
the files were based on plotmanagement heres the revelant parts
//vaultaddfriends.sqf private ["_vaults","_inList","_toAdd","_thevault","_friends","_friendUID","_friendName","_userList"]; disableSerialization; _userList = (findDisplay 711198) displayCtrl 7011; _friendUID = _this select 0; _friendName = _userList lbText (lbCurSel _userList); if (_friendUID == "") exitWith {}; _vaults = nearestObjects [[player] call FNC_getPos, [DZE_LockedStorage],15]; _thevault = _vaults select 0; _friends = _thevault getVariable ["vaultFriends",[]]; _toAdd = [_friendUID,toArray _friendName]; _inList = false; { if ((_x select 0) == (_toAdd select 0)) exitWith { _inList = true; }; } count _friends; if (_inList) exitWith { systemChat localize "STR_EPOCH_PLOTMANAGEMENT_ADDFRIEND_ALREADYONTHELIST"; }; if ((count _friends) == DZE_Max_thevaultFriends) exitWith { systemChat format[localize "STR_EPOCH_PLOTMANAGEMENT_ADDFRIEND_FRIENDLIMIT", DZE_Max_thevaultFriends]; }; _friends set [(count _friends), _toAdd]; _thevault setVariable ["vaultFriends", _friends, true]; PVDZ_veh_Save = [_thevault,"damage"]; publicVariableServer "PVDZ_veh_Save"; call PlotGetFriends; call PlotNearbyHumans;
server_monitor.sqf
if( (count _inventory > 0) && !_isPlot && !_doorLocked) then { if (_type in DZE_LockedStorage) then { // Do not send big arrays over network! Only server needs these _object setVariable ["WeaponCargo",(_inventory select 0),false]; _object setVariable ["MagazineCargo",(_inventory select 1),false]; _object setVariable ["BackpackCargo",(_inventory select 2),false]; _object setVariable ["vaultFriends", _hitPoints, true]; } else { _weaponcargo = _inventory select 0 select 0; _magcargo = _inventory select 1 select 0; _backpackcargo = _inventory select 2 select 0; _weaponqty = _inventory select 0 select 1; {_object addWeaponCargoGlobal [_x, _weaponqty select _foreachindex];} foreach _weaponcargo; _magqty = _inventory select 1 select 1; {_object addMagazineCargoGlobal [_x, _magqty select _foreachindex];} foreach _magcargo; _backpackqty = _inventory select 2 select 1; {_object addBackpackCargoGlobal [_x, _backpackqty select _foreachindex];} foreach _backpackcargo; }; } else { if (DZE_permanentPlot && _isPlot) then { _object setVariable ["plotfriends", _inventory, true]; }; if (DZE_doorManagement && _doorLocked) then { _object setVariable ["doorfriends", _inventory, true]; }; if (_vault) then { _object setVariable ["vaultFriends", _hitPoints, true]; }; }; };
server_updateObject.sqf
_object_damage = { //Allow dmg process private ["_hitpoints","_array","_hit","_selection","_key","_damage","_allFixed"]; if ((typeOf (_object) in DZE_LockedStorage)) then { _damage = damage _object; _array = _object getVariable ["vaultFriends",[]]; _allFixed = false; }; } else { _hitpoints = _object call vehicle_getHitpoints; _damage = damage _object; _array = []; _allFixed = true; { _hit = [_object,_x] call object_getHit; _selection = getText (configFile >> "CfgVehicles" >> (typeOf _object) >> "HitPoints" >> _x >> "name"); if (_hit > 0) then { _allFixed = false; _array set [count _array,[_selection,_hit]]; //diag_log format ["Section Part: %1, Dmg: %2",_selection,_hit]; } else { _array set [count _array,[_selection,0]]; }; } forEach _hitpoints; }; if (_allFixed && !_totalDmg) then {_object setDamage 0;}; if (_forced) then { if (_object in needUpdate_objects) then {needUpdate_objects = needUpdate_objects - [_object];}; _recorddmg = true; } else { //Prevent damage events for the first 10 seconds of the servers live. if (diag_ticktime - _lastUpdate > 10) then { if !(_object in needUpdate_objects) then { //diag_log format["DEBUG: Monitoring: %1",_object]; needUpdate_objects set [count needUpdate_objects, _object]; _recorddmg = true; }; }; }; if (_recorddmg) then { if (_objectID == "0") then { _key = format["CHILD:306:%1:",_objectUID] + str _array + ":" + str _damage + ":"; } else { _key = format["CHILD:306:%1:",_objectID] + str _array + ":" + str _damage + ":"; }; #ifdef OBJECT_DEBUG diag_log ("HIVE: WRITE: "+ str(_key)); #endif _key call server_hiveWrite; }; };
Right now the value im getting into Hitpoints field is [["76561197963145366",[83,109,111,107,101,121]]]
Link to comment
Share on other sites
10 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