Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "..\..\script_macros.hpp"
- /*
- File: fn_handleDamage.sqf
- Author: Bryan "Tonic" Boardwine
- Description:
- Handles damage, specifically for handling the 'tazer' pistol and nothing else.
- */
- params [
- ["_unit",objNull,[objNull]],
- ["_part","",[""]],
- ["_damage",0,[0]],
- ["_source",objNull,[objNull]],
- ["_projectile","",[""]],
- ["_index",0,[0]]
- ];
- if (!isNull _source && {_source != _unit}) then {
- if (side _source isEqualTo west) then {
- if (currentWeapon _source in ["hgun_P07_snds_F","arifle_SDAR_F"] && _projectile in ["B_9x21_Ball","B_556x45_dual"]) then {
- if (alive _unit) then {
- if (playerSide isEqualTo civilian && {!life_is_tazed}) then {
- private _distance = 35;
- if (_projectile isEqualTo "B_556x45_dual") then {_distance = 100};
- if (_unit distance _source < _distance) then {
- if !(isNull objectParent _unit) then {
- if (typeOf (vehicle _unit) isEqualTo "B_Quadbike_01_F") then {
- _unit action ["Eject",vehicle _unit];
- [_unit,_source] spawn life_fnc_tazed;
- };
- } else {
- [_unit,_source] spawn life_fnc_tazed;
- };
- };
- };
- _damage = if (_part isEqualTo "") then {
- damage _unit;
- } else {
- _unit getHit _part;
- };
- };
- };
- };
- };
- //--- Crashed Vehicle
- if ( vehicle _unit isKindOf "Car" && { isNull _source } || { _source isEqualTo _unit } ) then {
- //--- Seatbelt on
- if ( IRT_SeatBelt ) then {
- //--- Divide Damage in Half
- _damage = _damage / 2;
- //--- Take SeatBelt Off
- IRT_SeatBelt = false;
- };
- };
- [] spawn life_fnc_hudUpdate;
- _damage;
Add Comment
Please, Sign In to add comment