Advertisement
Guest User

player disconnect

a guest
Jul 21st, 2013
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MySQL 1.26 KB | None | 0 0
  1. private ["_object","_myGroup","_id","_playerID","_playerName","_characterID","_playerIDtoarray","_timeout"];
  2. _playerID = _this select 0;
  3. _playerName = _this select 1;
  4. _object = call compile format["player%1",_playerID];
  5. _characterID =  _object getVariable ["characterID","0"];
  6. _timeout = _object getVariable["combattimeout",0];
  7.  
  8. _playerIDtoarray = [];
  9. _playerIDtoarray = toArray _playerID;
  10.  
  11. if (vehicle _object != _object) then {
  12.     _object action ["eject", vehicle _object];
  13. };
  14.  
  15. if (59 in _playerIDtoarray) exitWith {  diag_log ("Exited"); };
  16.  
  17. if ((_timeout - time) > 0) then {
  18.     diag_log format["COMBAT LOGGED: %1 (%2)", _playerName,_timeout];
  19.     if (alive _object) then {
  20.         [_playerID, _characterID, typeof _object, _object] spawn server_botSetup;
  21.     };
  22. };
  23.  
  24. diag_log format["DISCONNECT: %1 (%2) Object: %3, _characterID: %4", _playerName,_playerID,_object,_characterID];
  25.  
  26. dayz_disco = dayz_disco - [_playerID];
  27. if (!isNull _object) then {
  28.     _charPos = getPosATL _object;
  29.     [_charPos] call server_updateNearbyObjects;
  30.  
  31.     if (alive _object) then {
  32.         [_object, (magazines _object), true] call server_playerSync;
  33.         _myGroup = group _object;
  34.         deleteVehicle _object;
  35.         deleteGroup _myGroup;
  36.     };
  37.  
  38.     [_playerID,_characterID,2] call dayz_recordLogin;
  39. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement