Advertisement
Guest User

Untitled

a guest
Feb 10th, 2018
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.03 KB | None | 0 0
  1. #include "..\..\script_macros.hpp"
  2. /*
  3. File: fn_handleDamage.sqf
  4. Author: Bryan "Tonic" Boardwine
  5.  
  6. Description:
  7. Handles damage, specifically for handling the 'tazer' pistol and nothing else.
  8. */
  9. params [
  10. ["_unit",objNull,[objNull]],
  11. ["_part","",[""]],
  12. ["_damage",0,[0]],
  13. ["_source",objNull,[objNull]],
  14. ["_projectile","",[""]],
  15. ["_index",0,[0]]
  16. ];
  17.  
  18. //Handle the tazer first (Top-Priority).
  19. if (!isNull _source) then {
  20. if (_source != _unit) then {
  21. if (currentWeapon _source in ["hgun_P07_snds_F","arifle_SDAR_F"] && _projectile in ["B_9x21_Ball","B_556x45_dual"]) then {
  22. if (side _source isEqualTo west && playerSide isEqualTo civilian) then {
  23. _damage = 0;
  24. if (alive player && !life_istazed && !life_isknocked && !(_unit getVariable ["restrained",false])) then {
  25. private ["_distance"];
  26. _distance = 35;
  27. if (_projectile == "B_556x45_dual") then {_distance = 100;};
  28. if (_unit distance _source < _distance) then {
  29. if !(isNull objectParent player) then {
  30. if (typeOf (vehicle player) == "B_Quadbike_01_F") then {
  31. player action ["Eject",vehicle player];
  32. [_unit,_source] spawn life_fnc_tazed;
  33. };
  34. } else {
  35. [_unit,_source] spawn life_fnc_tazed;
  36. };
  37. };
  38. };
  39. };
  40.  
  41. //Temp fix for super tasers on cops.
  42. if (side _source isEqualTo west && (playerSide isEqualTo west || playerSide isEqualTo independent)) then {
  43. _damage = 0;
  44. };
  45. };
  46. };
  47. };
  48.  
  49. [] spawn life_fnc_hudUpdate;
  50. _damage;
  51.  
  52. if ((vehicle _unit) isKindOf "Car" && (isNull _source || _source isEqualTo _unit)) then
  53. {
  54. _damage = if (life_seatbelt) then { _damage / 2 } else { _damage};
  55. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement