Wenn ich eine Person taser passiert nichts. Modtaser: A3L taser
Code: fn_handleDamage.sqf
/*
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;
/*
_unit = _this select 1;
_part = _this select 5;
_damage = _this select 10;
_source = _this select 0;
_projectile = _this select 2;
*/
//Internal Debugging.
if(!isNil "TON_Debug") then {
systemChat format["PART: %1 || DAMAGE: %2 || SOURCE: %3 || PROJECTILE: %4 || FRAME: %5",_part,_damage,_source,_projectile,diag_frameno];
};
//Handle the tazer first (Top-Priority).
if(!isNull _source) then {
if(_source != _unit) then {
_curWep = currentWeapon _source;
if(_projectile in ["26_taser"] && _curWep in ["Taser_26"]) then {
if(side _source == west && playerSide != west) then {
private["_distance","_isVehicle","_isQuad"];
_distance = if(_projectile == "B_556x45_dual") then {100} else {35};
_isVehicle = if(vehicle player != player) then {true} else {false};
_isQuad = if(_isVehicle) then {if(typeOf (vehicle player) == "B_Quadbike_01_F") then {true} else {false}} else {false};
_damage = false;
if(_unit distance _source < _distance) then {
if(!life_istazed && !(_unit getVariable["restrained",false])) then {
if(_isVehicle && _isQuad) 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(playerSide == west && side _source == west) then {
_damage = false;
};
};
};
};
//[] call life_fnc_hudUpdate;
_damage;
Alles anzeigen
Code: fn_tazed.sqf
/*
/*
File: fn_tazed.sqf
Author: Bryan "Tonic" Boardwine
Description:
Starts the tazed animation and broadcasts out what it needs to.
*/
private["_unit","_shooter","_curWep","_curMags","_attach"];
_unit = [_this,0,Objnull,[Objnull]] call BIS_fnc_param;
_shooter = [_this,1,Objnull,[Objnull]] call BIS_fnc_param;
if(isNull _unit OR isNull _shooter) exitWith {player allowDamage true; life_istazed = false;};
if(_shooter isKindOf "Man" && alive player) then
{
if(!life_istazed) then
{
diag_log format ["= TAZER NOTIFICATION :: %1 wurde von %2 tazed.",name _unit, name _shooter];
life_istazed = true;
player setVariable ["tf_unable_to_use_radio", true];
_curWep = currentWeapon player;
_curMags = magazines player;
_attach = if(primaryWeapon player != "") then {primaryWeaponItems _unit} else {[]};
{player removeMagazine _x} foreach _curMags;
player removeWeapon _curWep;
player addWeapon _curWep;
if(count _attach != 0 && primaryWeapon _unit != "") then
{
{
_unit addPrimaryWeaponItem _x;
} foreach _attach;
};
if(count _curMags != 0) then
{
{player addMagazine _x;} foreach _curMags;
};
[_unit,1] remoteExecCall ["life_fnc_tazeSound",-2];
/* New Animation (Ragdoll Effect) */
enableCamshake true;
addCamShake [50,5,30];
disableUserInput true;
player allowDamage false;
if (vehicle player == player) then {
private ["_ragdoll"];
player allowDamage false;
_ragdoll = "Land_Can_V3_F" createVehicleLocal [0,0,0];
_ragdoll setMass 1e10;
_ragdoll attachTo [player, [0,0,0], "Spine3"];
_ragdoll setVelocity [0,0,6];
player allowDamage false;
detach _ragdoll;
0 = _ragdoll spawn {
deleteVehicle _this;
player allowDamage true;
};
};
sleep 0.5;
player allowDamage true; //Double-Check
sleep 4;
_obj = "Land_ClutterCutter_small_F" createVehicle (getPosATL _unit);
_obj setPosATL (getPosATL _unit);
[player,"static_dead"] remoteExec ["life_fnc_animSync",-2];
_unit attachTo [_obj,[0,0,0]];
sleep 12;
[player,"amovppnemstpsraswrfldnon"] remoteExec ["life_fnc_animSync",-2];
if(!(player getVariable["Escorting",false])) then {
detach player;
};
player setVariable ["tf_unable_to_use_radio", false];
life_istazed = false;
player allowDamage true;
disableUserInput false;
};
}
else
{
_unit allowDamage true;
life_istazed = false;
};
player setVariable ["tf_unable_to_use_radio", false];
Alles anzeigen