Moin wir haben von vvv den taser bekommen doch leider tasert er nicht.
HandleDamage
Code
/*
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;
//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];
};
//26_taser
//Handle the tazer first (Top-Priority).
if(!isNull _source) then {
if(_source != _unit) then {
_curWep = currentWeapon _source;
if(_projectile in ["26_cartridge","B_9x21_Ball","B_556x45_Ball_Tracer_Green"] && _curWep in ["Taser_26","hgun_P07_snds_F","SMG_02_ARCO_pointg_F","arifle_Mk20_GL_MRCO_pointer_F"]) then {
private["_distance","_isVehicle","_isQuad"];
_distance = if(_curWep IN ["SMG_02_ARCO_pointg_F","arifle_Mk20_GL_MRCO_pointer_F"]) then {150} else {50};
_isVehicle = if(vehicle _unit != player) then {true} else {false};
_isQuad = if(_isVehicle) then {if(typeOf (vehicle player) IN ["B_Quadbike_01_F","sfp_wheelchair_mark2","C_Rubberboat","C_Boat_Civil_01_F","A3L_Jetski","A3L_Jetski_yellow","B_Boat_Transport_01_F","C_Boat_Civil_01_police_F","B_Boat_Armed_01_minigun_F","B_Lifeboat","C_Boat_Civil_01_rescue_F","ebike_epoch","cl3_xr_1000_police","cl3_enduro_police","cl3_xr_1000_emt","cl3_enduro_emt"]) then {true} else {false};};
_damage = false;
if((_unit distance _source < _distance)) then {
if(!life_istazed && !(_unit getVariable["restrained",false])) then {
//[_unit,_source] spawn life_fnc_tazed;
if(_isVehicle) then {
if(_isQuad) then {
player action ["Eject",vehicle player];
[_unit,_source] spawn life_fnc_tazed;
};
} else {
[_unit,_source] spawn life_fnc_tazed;
};
};
};
};
};
};
//anti vdm
/*
if (vehicle _unit == _unit) then {
if ( _source isKindOf "Air" OR _source isKindOf "Car" OR _source isKindOf "Boat" OR _source isKindOf "tcg_hrly" OR _source isKindOf "landVehicle") then
{
diag_log "Die Quelle ist ein Fahrzeug ohne Fahrer";
_damage = false;
[[player,"amovppnemstpsraswrfldnon"],"life_fnc_animSync",true,false] spawn life_fnc_MP;
} else {
_isVehicle = vehicle _source;
if (_isVehicle isKindOf "Air" OR _isVehicle isKindOf "Car" OR _isVehicle isKindOf "Boat" OR _isVehicle isKindOf "tcg_hrly" OR _isVehicle isKindof "landVehicle") then
{
diag_log "Die Quelle ist ein Fahrzeug mit Fahrer";
_damage = false;
[[player,"amovppnemstpsraswrfldnon"],"life_fnc_animSync",true,false] spawn life_fnc_MP;
};
};
};
*/
[] call life_fnc_hudUpdate;
_damage;
Alles anzeigen
Vielleicht sieht einer von euch ja den Fehler.
Mit freundlichen Grüßen