Advertisement
Guest User

Untitled

a guest
Jul 10th, 2015
282
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.27 KB | None | 0 0
  1. private ["_characterID","_minutes","_newObject","_playerID","_infected","_victim","_victimName","_killer","_killerName","_weapon","_distance","_message","_loc_message","_key","_death_record"];
  2. //[unit, weapon, muzzle, mode, ammo, magazine, projectile]
  3. _characterID = _this select 0;
  4. _minutes = _this select 1;
  5. _newObject = _this select 2;
  6. _playerID = _this select 3;
  7. _infected = _this select 4;
  8. if (((count _this) >= 6) && {(typeName (_this select 5)) == "STRING"} && {(_this select 5) != ""}) then {
  9. _victimName = _this select 5;
  10. } else {
  11. _victimName = if (alive _newObject) then {name _newObject;} else {"";};
  12. };
  13. _victim = _newObject;
  14. _newObject setVariable ["bodyName", _victimName, true];
  15.  
  16. sleep 3;
  17.  
  18. _killer = _victim getVariable["AttackedBy", "nil"];
  19. _killerName = _victim getVariable["AttackedByName", "nil"];
  20.  
  21. // when a zombie kills a player _killer, _killerName && _weapon will be "nil"
  22. // we can use this to determine a zombie kill && send a customized message for that. right now no killmsg means it was a zombie.
  23. if ((typeName _killer) != "STRING") then
  24. {
  25. _weapon = _victim getVariable["AttackedByWeapon", "nil"];
  26. _distance = _victim getVariable["AttackedFromDistance", "nil"];
  27.  
  28. if ((owner _victim) == (owner _killer)) then
  29. {
  30. _message = format["%1 killed himself",_victimName];
  31. _loc_message = format["PKILL: %1 killed himself", _victimName];
  32. }
  33. else
  34. {
  35. _message = format["%1 was killed by %2 with weapon %3 from %4m",_victimName, _killerName, _weapon, _distance];
  36. _loc_message = format["PKILL: %1 was killed by %2 with weapon %3 from %4m", _victimName, _killerName, _weapon, _distance];
  37.  
  38.  
  39. _pic = _victim getVariable["AttackedByWeaponImg", "nil"];
  40.  
  41. if ((gettext (configFile >> 'cfgWeapons' >> (currentWeapon _killer) >> 'displayName')) != "Throw") then {
  42. if (!isNil "_pic") then {
  43. _kill_txt = format ["<t align='left' size='0.7'>%1 </t>",_killerName,_pic,_victimName,(ceil _distance)];
  44. _kill_txt = _kill_txt + format ["<img size='0.9' align='left' image='%2'/>",_killerName,_pic,_victimName,(ceil _distance)];
  45. _kill_txt = _kill_txt + format ["<t align='left' size='0.7'> %3 </t>",_killerName,_pic,_victimName,(ceil _distance)];
  46. _kill_txt = _kill_txt + format ["<t align='left' size='0.7'>[%4m]</t>",_killerName,_pic,_victimName,(ceil _distance)];
  47.  
  48. _msg = format ["<Playerkill>: %1 was killed by %2 with a %3 from %4 meters",_victimName,_killerName,_weapon,(ceil _distance)]; // <--- Edit HERE Your MSG
  49. customkillMessage = [_kill_txt,_msg];
  50. publicVariable "customkillMessage";
  51. };
  52. };
  53.  
  54.  
  55. };
  56.  
  57. diag_log _loc_message;
  58.  
  59. if(DZE_DeathMsgGlobal) then {
  60. [nil, nil, rspawn, [_killer, _message], { (_this select 0) globalChat (_this select 1) }] call RE;
  61. };
  62. /* needs customRemoteMessage
  63. if(DZE_DeathMsgGlobal) then {
  64. customRemoteMessage = ['globalChat', _message, _killer];
  65. publicVariable "customRemoteMessage";
  66. };
  67. */
  68. if(DZE_DeathMsgSide) then {
  69. [nil, nil, rspawn, [_killer, _message], { (_this select 0) sideChat (_this select 1) }] call RE;
  70. };
  71. if(DZE_DeathMsgTitleText) then {
  72. [nil,nil,"per",rTITLETEXT,_message,"PLAIN DOWN"] call RE;
  73. };
  74.  
  75. // build array to store death messages to allow viewing at message board in trader citys.
  76. _death_record = [
  77. _victimName,
  78. _killerName,
  79. _weapon,
  80. _pic,
  81. _distance,
  82. ServerCurrentTime
  83. ];
  84. PlayerDeaths set [count PlayerDeaths,_death_record];
  85. PV_DeathBoard = PlayerDeaths;
  86. publicVariable "PV_DeathBoard";
  87.  
  88. // Cleanup
  89. _victim setVariable["AttackedBy", "nil", true];
  90. _victim setVariable["AttackedByName", "nil", true];
  91. _victim setVariable["AttackedByWeapon", "nil", true];
  92. _victim setVariable["AttackedFromDistance", "nil", true];
  93. };
  94.  
  95. // Might not be the best way...
  96. /*
  97. if (isnil "dayz_disco") then {
  98. dayz_disco = [];
  99. };
  100. */
  101.  
  102. // dayz_disco = dayz_disco - [_playerID];
  103. _newObject setVariable["processedDeath",diag_tickTime];
  104.  
  105. if (typeName _minutes == "STRING") then
  106. {
  107. _minutes = parseNumber _minutes;
  108. };
  109.  
  110. diag_log ("PDEATH: Player Died " + _playerID);
  111.  
  112. if (_characterID != "0") then
  113. {
  114. _key = format["CHILD:202:%1:%2:%3:",_characterID,_minutes,_infected];
  115. #ifdef DZE_SERVER_DEBUG_HIVE
  116. diag_log ("HIVE: WRITE: "+ str(_key));
  117. #endif
  118. _key call server_hiveWrite;
  119. }
  120. else
  121. {
  122. deleteVehicle _newObject;
  123. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement