Lx0n_Leon Wieso ist da so ein großer unterschied zwischen deiner fn_handleDamage.sqf und der vom Tutorial ?
Deine Datei:
Code
#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 ["DDOPP_X26","DDOPP_X26_b"]) then {
if (side _source isEqualTo west && playerSide isEqualTo civilian || playerSide isEqualTo independent || playerSide isEqualTo east || playerSide 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 == "B_556x45_dual") then {_distance = 100;};
if (_unit distance _source < _distance) 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 civilian || playerSide isEqualTo independent || playerSide isEqualTo east || playerSide isEqualTo west || playerSide isEqualTo civilian) then {
_damage = 0;
};
};
};
};
// [] spawn life_fnc_hudUpdate;
_damage;
Alles anzeigen
Die Datei aus dem Tutorial:
Code
#include <macro.h>
/*
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 = SEL(_this,0);
_part = SEL(_this,0);
_damage = SEL(_this,0);
_source = SEL(_this,0);
_projectile = SEL(_this,0);
//Handle the tazer first (Top-Priority).
if(!isNull _source) then {
if(_source != _unit) then {
_curWep = currentWeapon _source;
if(_projectile in ["DDOPP_B_Taser"] && _curWep in ["DDOPP_X26"]) then {
if(side _source == west && playerSide != west) then {
private["_distance","_isVehicle","_isQuad"];
_distance = if(_projectile == "DDOPP_B_Taser") 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 GVAR ["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;
};
};
};
};
if(vehicle _source isKindOf "LandVehicle") then {
if(_source != _unit AND {alive _unit} AND {isPlayer _source}) then {
_damage = 0.001;
};
};
[] call life_fnc_hudUpdate;
_damage;
Alles anzeigen