Advertisement
Guest User

Untitled

a guest
Oct 23rd, 2017
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.23 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. if ((vehicle _unit) isKindOf "Car" && (isNull _source || _source isEqualTo _unit)) then
  19. {
  20. _damage = if (life_seatbelt) then { _damage / 2 } else { _damage};
  21. };
  22.  
  23.  
  24. //Handle the tazer first (Top-Priority).
  25. if (!isNull _source) then {
  26. if (_source != _unit) then {
  27. if (currentWeapon _source in ["hgun_P07_snds_F","arifle_SDAR_F"] && _projectile in ["B_9x21_Ball","B_556x45_dual"]) then {
  28. if (side _source isEqualTo west && playerSide isEqualTo civilian) then {
  29. _damage = 0;
  30. if (alive player && !life_istazed && !life_isknocked && !(_unit getVariable ["restrained",false])) then {
  31. private ["_distance"];
  32. _distance = 35;
  33. if (_projectile == "B_556x45_dual") then {_distance = 100;};
  34. if (_unit distance _source < _distance) then {
  35. if !(isNull objectParent player) then {
  36. if (typeOf (vehicle player) == "B_Quadbike_01_F") then {
  37. player action ["Eject",vehicle player];
  38. [_unit,_source] spawn life_fnc_tazed;
  39. };
  40. } else {
  41. [_unit,_source] spawn life_fnc_tazed;
  42. };
  43. };
  44. };
  45. };
  46.  
  47. //ANTI VDM
  48. if(vehicle _source isKindOf "LandVehicle") then {
  49. if(_source != _unit AND {alive _unit} AND {isPlayer _source}) then {
  50. _damage = 0.001;
  51. };
  52. };
  53.  
  54. //Temp fix for super tasers on cops.
  55. if (side _source isEqualTo west && (playerSide isEqualTo west || playerSide isEqualTo independent)) then {
  56. _damage = 0;
  57. };
  58. };
  59. };
  60. };
  61.  
  62. [] spawn life_fnc_hudUpdate;
  63. _damage;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement