Jump to content
KillerAussie

Tazer Healing Exploit [FIX]

Recommended Posts

I don't know about you but when I see cops abusing the handleDamage script to insta' heal a colleague it infuriates me.

In wake of this issue we were having, a friend of mine @Rogue added a fix for this to our mission, and  I thought others might like to enjoy it.

This FIX will stop tazers from healing people. 

 

This particular work is mine to share.

So here goes nothing.

Step 1: 

Open "Altis_Life\core\functions\fn_handleDamage.sqf".

Spoiler
#include "..\..\script_macros.hpp"
/*
    File: fn_handleDamage.sqf
    Author: Bryan "Tonic" Boardwine

    Description:
    Handles damage, specifically for handling the 'tazer' pistol and nothing else.
*/
private["_unit","_damage","_source","_projectile","_part","_curWep","_originalDamage"];
_unit = _this select 0;
_part = _this select 1;
_damage = _this select 2;
_source = _this select 3;
_projectile = _this select 4;

//Handle the tazer first (Top-Priority).
if (!isNull _source) then {
    if (_source != _unit) then {
        if (_unit getVariable["Revive",false]) exitWith {};
        _curWep = currentWeapon _source;
        if (_projectile in SG_TazerBullets && _curWep in SG_TazerWeps) then {
            if (side _source isEqualTo west && playerSide isEqualTo civilian) then {
                private["_distance"];
                _distance = if (_projectile == "B_556x45_dual") then {100} else {35};
                _damage = 0;
                if (_unit distance _source < _distance) then {
                    if (!life_istazed && !life_isknocked && !(_unit getVariable ["restrained",false])) then {
                        if (vehicle player != player) then {
                            if (typeOf (vehicle player) == "B_Quadbike_01_F") then {
                                player action ["Eject",vehicle player];
                                [_unit,_source] spawn life_fnc_tazed;
                            };
                        } else {
                            [_unit,_source] spawn life_fnc_tazed;
                        };
                    };
                };
            };

            //Temp fix for super tasers on cops.
            if (side _source isEqualTo west && (playerSide isEqualTo west || playerSide isEqualTo independent)) then {
                _damage = 0;
            };
        };
    };
};

[] spawn life_fnc_hudUpdate;
_damage;

 

Step 2:

Find the following code:

_projectile = _this select 4;

And then add this below it:

_originalDamage = if (_part == "") then {damage _unit} else {_unit getHit _part}; 

Step 3:

Replace all of the lines of code like this:

_damage = 0;

With this line of code:

_damage = _originalDamage;

And you're done, hope this helps some people out. Let me know if there was any issues.

Edited by KillerAussie

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...