player2_dz

Untitled

Aug 31st, 2016
213
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
SQF 1.97 KB | None | 0 0
  1. private ["_inp","_v", "_a","_wep","_dist","_dm","_r"];
  2. _inp = _this;
  3. _v =    _inp select 0;
  4. _a =    _inp select 1;
  5. _dm =   _inp select 2;
  6. _r = false;
  7.  
  8. if (!isPlayer _v) exitWith {};
  9. if ((owner _v) == (owner _a)) exitWith {
  10.     _v setVariable["AttackedBy", _v, true];
  11. };
  12.  
  13. /*---------------------------------------------------------------------------
  14. Fix for A.I. Death Messages/Logging (isPlayer _a removed from 1st exitWith)
  15. ---------------------------------------------------------------------------*/
  16. _r = [_inp select 0, _inp select 1] call p2aiCheck;
  17. if (_r) exitWith {  };
  18. _wep = nil;
  19. _wep = weaponState _a;
  20. //Validate weapon
  21. if (isNil '_wep' && {(str(_wep) != str([])) && ((str(_wep)) != (str("")))}) then {
  22.     _wep = (currentWeapon _a);
  23.     if (isNil '_wep') then {
  24.         _wep = "Unknown";
  25.     };
  26. } else {
  27.     //Weaponstate returned a value
  28.     //  Check if it is throwing weapon
  29.     if ((_wep select 0 == "Throw") && ((count _wep) > 2)) then
  30.     {
  31.         //Get thrown weapon
  32.         _wep = _wep select 3;
  33.         //Validate thrown weapon
  34.         if (isNil '_wep' && {(str(_wep) != str([])) && ((str(_wep)) != (str("")))}) then {
  35.             _wep = (currentWeapon _a);
  36.             if (isNil '_wep') then {
  37.                 _wep = "Unknown";
  38.             };
  39.         };
  40.     } else {
  41.         //Get non-thrown weapon
  42.         _wep = _wep select 0;
  43.         //Validate weapon
  44.         if (isNil '_wep' && {(str(_wep) != str([])) && ((str(_wep)) != (str("")))}) then {
  45.             _wep = (currentWeapon _a);
  46.             if (isNil '_wep') then {
  47.                 _wep = "Unknown";
  48.             };
  49.         };
  50.     };
  51. };
  52.  
  53.  
  54. _veh = typeOf (vehicle _a);
  55. if ((getText (configFile >> "CfgVehicles" >> _veh >> "vehicleClass")) in ["CarW","Car","CarD","Armored","Ship","Support","Air","ArmouredW","ArmouredD","SupportWoodland_ACR"]) then {
  56.     _wep = getText (configFile >> "CfgVehicles" >> _veh >> "displayName");
  57. };
  58.  
  59. _dist = _v distance _a;
  60.  
  61. _v setVariable["AttackedBy", _a, true];
  62. _v setVariable["AttackedByName", (name _a), true];
  63. _v setVariable["AttackedByWeapon", _wep, true];
  64. _v setVariable["AttackedFromDistance", _dist, true];
Add Comment
Please, Sign In to add comment