Tazer geht wohl doch nicht aber hier vielleicht wisst ihr weiter...
Spoiler anzeigen
#include "..\..\script_macros.hpp"
/*
File: fn_tazed.sqf
Author: Bryan "Tonic" Boardwine
Editor: Repentz to improve the function
Description:
Starts the tazed animation and broadcasts out what it needs to.
*/
private["_unit","_shooter","_curWep","_curMags","_attach"];
_unit = param [0,Objnull,[Objnull]];
_shooter = param [1,Objnull,[Objnull]];
if(isNull _unit OR isNull _shooter) exitWith {player allowDamage true; life_istazed = false;};
if(player getVariable["restrained",false]) exitWith {};
_time = time;
if(_shooter isKindOf "Man" && alive player) then {
if(!life_istazed) then {
life_istazed = true;
"DynamicBlur" ppEffectEnable true;
"DynamicBlur" ppEffectAdjust [20];
"DynamicBlur" ppEffectCommit 1;
player allowDamage false;
if(isNull objectParent player) then {
for [{_x=1},{_x<=10},{_x=_x+1}] do { call SOCK_fnc_tazeRagdoll; sleep 0.1; if(animationState player == "unconscious") exitWith{}};
};
//[_unit] remoteExecCall ["life_fnc_tazeSound",RCLIENT];
[0,"STR_NOTF_Tazed",true,[profileName, _shooter getVariable["realname",name _shooter]]] remoteExecCall ["life_client_fnc_broadcast",-2];
disableUserInput true;
player setDamage 0;
waitUntil{animationState player != "unconscious"};
_anim = if(isNull objectParent player) then {"Incapacitated"} else {"kia_driver_mid01"};
[player,_anim] remoteExec ["life_client_fnc_animSync",0];
waitUntil{time - _time >= 15};
player allowDamage true;
if(!(player getVariable["Escorting",false])) then {
detach player;
};
"DynamicBlur" ppEffectEnable false;
life_istazed = false;
disableUserInput false;
player playMoveNow "amovppnemstpsraswrfldnon";
};
} else {
_unit allowDamage true;
life_iztazed = false;
};
Spoiler anzeigen
#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]]
];
//Handle the tazer first (Top-Priority).
if (!isNull _source) then {
if (_source != _unit) then {
if (currentWeapon _source in ["Taser_26"] && _projectile in ["26_taser"]) then {
//if (side _source isEqualTo west && playerSide isEqualTo civilian) then {
//_damage = 0;
if (alive player && !life_istazed && !life_isknocked && !(_unit getVariable ["restrained",false])) then {
private ["_distance"];
_distance = 35;
if (_projectile == "26_taser") 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 = 0;
};
};
};
};
[] spawn life_fnc_hudUpdate;
_damage;
https://mab.to/ynVRrdKJb Tazer pbo