Advertisement
Guest User

Untitled

a guest
Oct 19th, 2013
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.44 KB | None | 0 0
  1. #include "\z\addons\dayz_server\compile\server_toggle_debug.hpp"
  2. /*
  3.  
  4. */
  5. private ["_playerObj","_myGroup","_id","_playerUID","_playerName","_characterID","_playerIDtoarray","_timeout"];
  6. _playerUID = _this select 0;
  7. _playerName = _this select 1;
  8. _playerObj = nil;
  9. {
  10. if (getPlayerUID _x == _playerUID) exitWith { _playerObj = _x; };
  11. } forEach playableUnits;
  12.  
  13. if (isNil "_playerObj") exitWith {
  14. diag_log format["%1: nil player object, _this:%2", __FILE__, _this];
  15. };
  16.  
  17. if (!isNull _playerObj) then {
  18. // combatlog disconnect
  19. _characterID = _playerObj getVariable["characterID", "?"];
  20. _timeout = _playerObj getVariable["combattimeout",0];
  21. if ((_timeout - time) > 0) then {
  22. diag_log format["COMBAT LOGGED: %1 (%2)", _playerName,_timeout];
  23. _playerObj setVariable["USEC_BloodQty",1];
  24. _playerObj setVariable["USEC_injured", true]; // To injure them
  25. };
  26.  
  27. //Update Vehicle
  28. if (vehicle _playerObj != _playerObj) then {
  29. _playerObj action ["eject", vehicle _playerObj];
  30. };
  31. { [_x,"gear"] call server_updateObject } foreach
  32. (nearestObjects [getPosATL _playerObj, ["Car", "Helicopter", "Motorcycle", "Ship", "TentStorage", "StashSmall", "StashMedium"], 10]);
  33. if (alive _playerObj) then {
  34. //[_playerObj,(magazines _playerObj),true,(unitBackpack _playerObj)] call server_playerSync;
  35. [_playerObj,[],true] call server_playerSync;
  36. _myGroup = group _playerObj;
  37. deleteVehicle _playerObj;
  38. deleteGroup _myGroup;
  39. };
  40. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement