Advertisement
Guest User

Untitled

a guest
Apr 25th, 2016
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.06 KB | None | 0 0
  1. #include "\z\addons\dayz_server\compile\server_toggle_debug.hpp"
  2. private ["_playerObj","_myGroup","_playerUID","_playerPos","_playerName"];
  3. _playerUID = _this select 0;
  4. _playerName = _this select 1;
  5. _playerObj = nil;
  6. _playerPos = [];
  7. {
  8. if ((getPlayerUID _x) == _playerUID) exitWith { _playerObj = _x; _playerPos = getPosATL _playerObj;};
  9. } forEach playableUnits;
  10.  
  11. if (isNil "_playerObj") exitWith {
  12. diag_log format["%1: nil player object, _this:%2", __FILE__, _this];
  13. };
  14.  
  15. diag_log format["get: %1 (%2), sent: %3 (%4)",typeName (getPlayerUID _playerObj), getPlayerUID _playerObj, typeName _playerUID, _playerUID];
  16.  
  17. if (!isNull _playerObj) then {
  18. // log disconnect
  19. #ifdef LOGIN_DEBUG
  20. _characterID = _playerObj getVariable["characterID", "?"];
  21. _lastDamage = _playerObj getVariable["noatlf4",0];
  22. _Sepsis = _playerObj getVariable["USEC_Sepsis",false];
  23. // diag_log format ["%1 %2 %3", isNil "_timeout", typeName _timeout == 'SCALAR', _timeout];
  24. if (_Sepsis) then {
  25. _playerObj setVariable["USEC_infected",true,true];
  26. };
  27. _lastDamage = round(diag_ticktime - _lastDamage);
  28. diag_log format["Player UID#%1 CID#%2 %3 as %4, logged off at %5%6",
  29. getPlayerUID _playerObj, _characterID, _playerObj call fa_plr2str, typeOf _playerObj,
  30. (getPosATL _playerObj) call fa_coor2str,
  31. if ((_lastDamage > 5 AND {(_lastDamage < 30)}) AND {((alive _playerObj) AND {(_playerObj distance (getMarkerpos "respawn_west") >= 2000)})}) then {" while in combat ("+str(_lastDamage)+" seconds left)"} else {""}
  32. ];
  33. #endif
  34. //Update Vehicle
  35. if (vehicle _playerObj != _playerObj) then {
  36. _playerObj action ["eject", vehicle _playerObj];
  37. };
  38. if (alive _playerObj) then {
  39. //[_playerObj,(magazines _playerObj),true,(unitBackpack _playerObj)] call server_playerSync;
  40. [_playerObj,nil,true] call server_playerSync;
  41. _myGroup = group _playerObj;
  42. deleteVehicle _playerObj;
  43. deleteGroup _myGroup;
  44. };
  45. { [_x,"gear"] call server_updateObject } foreach
  46. (nearestObjects [_playerPos, ["Car", "Helicopter", "Motorcycle", "Ship", "TentStorage", "StashSmall", "StashMedium"], 10]);
  47. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement