Advertisement
Guest User

player_death.sqf

a guest
Feb 19th, 2015
218
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.54 KB | None | 0 0
  1. private ["_item","_text","_wait","_myPos","_dir","_kills","_heroKills","_killsH","_killsB","_humanity","_pos","_display","_body","_playerID","_array","_source","_method","_canHitFree","_isBandit","_punishment","_humanityHit","_myKills","_humanity","_kills","_killsV","_myGroup","_src","_sum"];
  2. if (deathHandled) exitWith {};
  3. deathHandled = true;
  4. disableSerialization;
  5. disableUserInput true;
  6.  
  7. _display = findDisplay 49;
  8. if(!isNull _display) then {_display closeDisplay 0};
  9. if (dialog) then {closeDialog 0};
  10. if (visibleMap) then {openMap false};
  11.  
  12. _body = player;
  13. _playerID = getPlayerUID player;
  14.  
  15. if (dayz_onBack != "") then {
  16. if !(isNull _body) then {
  17. _body addWeapon dayz_onBack;
  18. };
  19. };
  20.  
  21. _sum = 0;
  22. _kills = player getVariable["zombieKills",0];
  23. _heroKills = player getVariable["heroKills",0];
  24. _killsH = player getVariable["humanKills",0];
  25. _killsB = player getVariable["banditKills",0];
  26.  
  27. _characterID = player getVariable["characterID",0];
  28. _humanity = player getVariable["humanity",0];
  29. _humanity_CHK = player getVariable["humanity_CHK",_humanity];
  30.  
  31. // MW FRIENDLY CHECK @TODO
  32. if (iamMW) then {
  33. _sum = 50;
  34. _myPos = (getPos (vehicle player));
  35. _dir = (round (random 360));
  36. _pos = [((_myPos select 0)+4*sin(_dir)),((_myPos select 1)+4*cos(_dir)),0];
  37. PVOZ_MW_DEATH = [(getPos (vehicle player)),INT_NAME];
  38. publicVariableServer "PVOZ_MW_DEATH";
  39. terminate MWTHREAD;
  40. deleteMarker "mwMarker";
  41. deleteMarker "mwMarkerText";
  42. iamMW = false;
  43. } else {
  44. _sum = _sum + _heroKills + _killsH + _killsB;
  45. };
  46. /*
  47. player setVariable ["NORRN_unconscious", false, true];
  48. player setVariable ["unconsciousTime", 0, true];
  49. player setVariable ["USEC_isCardiac",false,true];
  50. player setVariable ["medForceUpdate",true,true];
  51. player setVariable ["bloodTaken", false, true];
  52. */
  53. r_player_unconscious = false;
  54. r_player_cardiac = false;
  55.  
  56. _body removeAllEventHandlers "FiredNear";
  57. _body removeAllEventHandlers "HandleDamage";
  58. _body removeAllEventHandlers "Killed";
  59. _body removeAllEventHandlers "Fired";
  60. _body removeAllEventHandlers "GetOut";
  61. _body removeAllEventHandlers "GetIn";
  62. _body removeAllEventHandlers "Local";
  63. _body removeAction s_tagfriendly;
  64. clearVehicleInit _body;
  65.  
  66. sleep 0.05;
  67.  
  68. PVDZ_plr_Death = [dayz_characterID,0,_body,_playerID,_kills,_heroKills,_killsH,_killsB,_humanity, _sum, str(getPlayerUIDold player), INT_NAME,INT_WEAPON,INT_DISTANCE];
  69. publicVariableServer "PVDZ_plr_Death";
  70.  
  71. player setDamage 1;
  72. player setVariable ["startcombattimer", 0];
  73.  
  74. _array = _this;
  75. if (count _array > 0) then {
  76. _method = _array select 1;
  77. _body setVariable ["deathType",_method,true];
  78. };
  79.  
  80. sleep 0.5;
  81.  
  82. 0.1 fadeSound 0;
  83.  
  84.  
  85. uisleep 1;
  86.  
  87.  
  88. deleteMarkerLocal "ripMarker";
  89. _pos = getPos (vehicle player);
  90. int_ripmarker = createMarkerLocal ["ripMarker", _pos];
  91. int_ripmarker setMarkerShapeLocal "ICON";
  92. int_ripmarker setMarkerAlphaLocal 1;
  93. int_ripmarker setMarkerPosLocal _pos;
  94. int_ripmarker setMarkerTextLocal "R.I.P.";
  95. int_ripmarker setMarkerColorLocal "ColorBlack";
  96. int_ripmarker setMarkerTypeLocal "waypoint";
  97. int_ripmarker setMarkerSizeLocal [0.8,0.8];
  98.  
  99. dayz_originalPlayer enableSimulation true;
  100. addSwitchableUnit dayz_originalPlayer;
  101. setPlayable dayz_originalPlayer;
  102. selectPlayer dayz_originalPlayer;
  103.  
  104. _myGroup = group _body;
  105. [_body] joinSilent dayz_firstGroup;
  106. deleteGroup _myGroup;
  107.  
  108. uisleep 1;
  109. cutText ["","BLACK OUT"];
  110.  
  111. uisleep 1.5;
  112. 0 fadeSound 0;
  113.  
  114. PVDZ_Server_Simulation = [_body, false];
  115. publicVariableServer "PVDZ_Server_Simulation";
  116.  
  117. uisleep 3;
  118.  
  119. disableUserInput false;
  120. [_characterID, _humanity, _humanity_CHK] spawn int_respawn;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement