Wir nutzen eig. den normalen Taser von Altis Life: Hier mal die fn_handleDamage.sqf
fn_handleDamage.sqf
#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"];
_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 (currentWeapon _source in ["hgun_P07_snds_F","CSW_M26C","arifle_SDAR_F"] && _projectile in ["B_9x21_Ball","B_556x45_dual","CSW_Taser_Probe_Mag"]) then {
if(side _source in [west, civilian, resistance] && playerSide != west) then {
_damage = 0;
if (alive player && !life_istazed && !life_isknocked && !(_unit getVariable ["restrained",false])) then {
private ["_distance"];
_distance = 35;
if (_projectile == "B_556x45_dual") then {_distance = 100;};
if (_unit distance _source < _distance) then {
if !(isNull objectParent 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 = false;
};
};
};
};
if ((vehicle _unit) isKindOf "Car" && (isNull _source _source isEqualTo _unit)) then
{
_damage = if (life_seatbelt) then { _damage / 2 } else { _damage};
};
if(vehicle _source isKindOf "LandVehicle") then {
if(_source != _unit AND {alive _unit} AND {isPlayer _source}) then {
_damage = 0.050;
};
};
[] spawn life_fnc_hudUpdate;
_damage;