SHARE
TWEET

Untitled

a guest Apr 20th, 2019 93 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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 ["CSW_M26C","IG_Taser_X26_Black","IG_Taser_X26","Taser_26"]) then {
  22.  if (side _source in [west,civilian,independent,east] && playerSide in [civilian,west,independent,east]) then {
  23.  _damage = 0;
  24.  if (alive player && !life_istazed && !life_isknocked ) then {
  25.  private ["_distance"];
  26.  _distance = 100;
  27.  //if (_projectile == "CSW_Taser_Ammo","IG_10Rnd_X3") then {_distance = 100;};
  28.  if (_unit distance _source < _distance) then {
  29.  if (vehicle player != player) then {
  30.  if (typeOf (vehicle player) isEqualTo "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 in [west,civilian] && (playerSide isEqualTo independent)) then {
  43.  _damage = 0;
  44.  };
  45.  
  46.  };
  47.  };
  48. };
  49.  
  50.  
  51. [] spawn life_fnc_hudUpdate;
  52. _damage;
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top