Advertisement
Ranzen

server_publishObject.sqf

Oct 8th, 2013
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.37 KB | None | 0 0
  1. private ["_class","_uid","_charID","_object","_worldspace","_key"];
  2. //[dayz_characterID,_tent,[_dir,_location],"TentStorage"]
  3. _charID = _this select 0;
  4. _object = _this select 1;
  5. _worldspace = _this select 2;
  6. _class = _this select 3;
  7.  
  8. #include "\z\addons\dayz_server\compile\server_toggle_debug.hpp"
  9.  
  10. //if (!(_object isKindOf "Building")) exitWith {
  11. // deleteVehicle _object;
  12. //};
  13. _allowed = [_object, "Server"] call check_publishobject;
  14. if (!_allowed) exitWith { };
  15.  
  16. //diag_log ("PUBLISH: Attempt " + str(_object));
  17.  
  18. //get UID
  19. _uid = _worldspace call dayz_objectUID2;
  20.  
  21. //Send request
  22. if (_object isKindOf "TrapItems") then {
  23. _key = format["CHILD:308:%1:%2:%3:%4:%5:%6:%7:%8:%9:",dayZ_instance, _class, 0 , _charID, _worldspace, [_object getVariable ["armed", false]], [], 0,_uid];
  24. } else {
  25. _key = format["CHILD:308:%1:%2:%3:%4:%5:%6:%7:%8:%9:",dayZ_instance, _class, 0 , _charID, _worldspace, [], [], 0,_uid];
  26. };
  27. //diag_log ("HIVE: WRITE: "+ str(_key));
  28. _key call server_hiveWrite;
  29.  
  30. _object setVariable ["ObjectUID", _uid,true];
  31.  
  32. if (_object isKindOf "TentStorage" || _object isKindOf "CamoNet_DZ") then {
  33. _object addMPEventHandler ["MPKilled",{_this call vehicle_handleServerKilled;}];
  34. };
  35.  
  36. dayz_serverObjectMonitor set [count dayz_serverObjectMonitor,_object];
  37.  
  38. #ifdef OBJECT_DEBUG
  39. diag_log ("PUBLISH: Created " + (_class) + " with ID " + _uid);
  40. #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement