Guest User

Untitled

a guest
Feb 4th, 2019
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.49 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. private["_unit","_damage","_source","_projectile","_part","_curWep"];
  10. _unit = SEL(_this,0);
  11. _part = SEL(_this,1);
  12. _damage = SEL(_this,2);
  13. _source = SEL(_this,3);
  14. _projectile = SEL(_this,4);
  15.  
  16. //Handle the tazer first (Top-Priority).
  17. if(!isNull _source) then {
  18. if(_source != _unit) then {
  19. _curWep = currentWeapon _source;
  20. if (currentWeapon _source in ["vvv_np_magazine_taser","arifle_SDAR_F"] && _projectile in ["B_9x21_Ball","B_556x45_dual"]) then {
  21. if(side _source == west && playerSide == civilian) then {
  22. private["_distance"];
  23. _distance = if(_projectile == "B_556x45_dual") then {100} else {35};
  24. _damage = false;
  25. if(_unit distance _source < _distance) then {
  26. if(!life_istazed && !life_isknocked && !(_unit GVAR ["restrained",false])) then {
  27. if (vehicle player != player) then {
  28. if (typeOf (vehicle player) == "B_Quadbike_01_F") then {
  29. player action ["Eject",vehicle player];
  30. [_unit,_source] spawn life_fnc_tazed;
  31. };
  32. } else {
  33. [_unit,_source] spawn life_fnc_tazed;
  34. };
  35. };
  36. };
  37. };
  38.  
  39. //Temp fix for super tasers on cops.
  40. if(side _source == west && (playerSide == west OR playerSide == independent)) then {
  41. _damage = false;
  42. };
  43. };
  44. };
  45. };
  46.  
  47. [] call life_fnc_hudUpdate;
  48. _damage;
Add Comment
Please, Sign In to add comment