Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private ["_inp","_v", "_a","_wep","_dist","_dm","_r"];
- _inp = _this;
- _v = _inp select 0;
- _a = _inp select 1;
- _dm = _inp select 2;
- _r = false;
- if (!isPlayer _v) exitWith {};
- if ((owner _v) == (owner _a)) exitWith {
- _v setVariable["AttackedBy", _v, true];
- };
- /*---------------------------------------------------------------------------
- Fix for A.I. Death Messages/Logging (isPlayer _a removed from 1st exitWith)
- ---------------------------------------------------------------------------*/
- _r = [_inp select 0, _inp select 1] call p2aiCheck;
- if (_r) exitWith { };
- _wep = weaponState _a;
- //Validate weapon
- if (isNil '_wep' && {(str(_wep) != str([])) && ((str(_wep)) != (str("")))}) then {
- _wep = (currentWeapon _a);
- if (isNil '_wep') then {
- _wep = "Unknown";
- };
- } else {
- //Weaponstate returned a value
- // Check if it is throwing weapon
- if ((_wep select 0 == "Throw") && ((count _wep) > 2)) then
- {
- //Get thrown weapon
- _wep = _wep select 3;
- //Validate thrown weapon
- if (isNil '_wep' && {(str(_wep) != str([])) && ((str(_wep)) != (str("")))}) then {
- _wep = (currentWeapon _a);
- if (isNil '_wep') then {
- _wep = "Unknown";
- };
- };
- } else {
- //Get non-thrown weapon
- _wep = _wep select 0;
- //Validate weapon
- if (isNil '_wep' && {(str(_wep) != str([])) && ((str(_wep)) != (str("")))}) then {
- _wep = (currentWeapon _a);
- if (isNil '_wep') then {
- _wep = "Unknown";
- };
- };
- };
- };
- _veh = typeOf (vehicle _a);
- if ((getText (configFile >> "CfgVehicles" >> _veh >> "vehicleClass")) in ["CarW","Car","CarD","Armored","Ship","Support","Air","ArmouredW","ArmouredD","SupportWoodland_ACR"]) then {
- _wep = getText (configFile >> "CfgVehicles" >> _veh >> "displayName");
- };
- _dist = _v distance _a;
- _v setVariable["AttackedBy", _a, true];
- _v setVariable["AttackedByName", (name _a), true];
- _v setVariable["AttackedByWeapon", _wep, true];
- _v setVariable["AttackedFromDistance", _dist, true];
Advertisement
Add Comment
Please, Sign In to add comment