Advertisement
Guest User

Untitled

a guest
Jun 23rd, 2017
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.48 KB | None | 0 0
  1. d3z_katana =
  2. {
  3.     private ["_u", "_difa", "_dif", "_dirT", "_dir", "_difb", "_nObjects"];
  4.     _u = _this select 2;
  5.     if (isPlayer _u) exitwith {};
  6.     _key = _this select 0;
  7.     _keyarray = _this select 1;
  8.     if ((_key select 1) in _keyarray) then
  9.     {
  10.         KatanaRDY = false;
  11.         //hint format["%1", _this select 1];
  12.         _wep = currentmuzzle player;
  13.         if (_wep == "d3z_katana") then
  14.         {
  15.             nul = [] execVM "d3z_katana\z\swing.sqf";
  16.             _nObjects = nearestObjects [player, ["Man"], 2];
  17.             {
  18.                 if ((count _nObjects > 1) and (_x != player) and alive _x and KilledOne) then
  19.                 {
  20.                     _posT = position _x;
  21.                     _posP = position player;
  22.                     _dir = direction player;
  23.                     //_weparray = player weaponDirection "d3z_katana" ;
  24.                     //_dir = (_weparray select 0) atan2 (_weparray select 1);
  25.                     _posDifx = (_posT select 0) - (_posP select 0);
  26.                     _posDify = (_PosT select 1) - (_posP select 1);
  27.                     _dirT = _posDifx atan2 _posDify;
  28.  
  29.                     if (_dir >= 180) then
  30.                     {
  31.                         _difa = (360 - _dir);
  32.                     }
  33.                     else
  34.                     {
  35.                         _difa = _dir;
  36.                     };
  37.  
  38.                     if (_dirT >= 180) then
  39.                     {
  40.                         _difb = abs(360 - _dirT);
  41.                     }
  42.                     else
  43.                     {
  44.                         _difb = abs(0 + _dirT);
  45.                     };
  46.  
  47.                     _max = _difa max _difb;
  48.                     _min = _difa min _difb;
  49.  
  50.                     _dif = _max - _min;
  51.                        
  52.                     if (_dif < 20) then
  53.                     {
  54.                         KilledOne = false;
  55.                         nul = [_x, _dif] execVM "d3z_katana\z\KillOne.sqf";
  56.                     };
  57.                 };
  58.             } forEach _nObjects;
  59.         };
  60.         nul = [] execVM "d3z_katana\z\maketrue.sqf";   
  61.     };
  62. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement