Advertisement
Nebulazer

Untitled

Aug 25th, 2016
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
SQF 1.72 KB | None | 0 0
  1. span class="re5"> params["_unit"];
  2.  
  3.     //Add event ( see initPlayerLocal.sqf for code comments )
  4.     _unit addEventHandler [ "Killed", {
  5.         _unit = _this select 0;
  6.         _killer = _this select 1;
  7.         _killerCar = vehicle _killer;
  8.  
  9.         if ( isPlayer _killer && !( _killer isEqualTo _unit ) ) then {
  10.  
  11.             _killedSide = ( getNumber ( configFile >> "CfgVehicles" >> typeOf _unit >> "side" ) ) call BIS_fnc_sideType;
  12.             _isEnemy = _killedSide getFriend side _killer < 0.6;
  13.  
  14.             if ( _isEnemy ) then {
  15.  
  16.                 [ 250, 100, 1 ] remoteExec [ "fnc_updateStats", _killer ];
  17.                     if (_killer in _killerCar) then
  18.                     {
  19.                         if (_killer == driver _killerCar) then
  20.                         {
  21.                         [ 250, 50, 1 ] remoteExec [ "fnc_updateStats", _killer ];
  22.                         };
  23.                         if (_killer == gunner _killerCar) then
  24.                         {
  25.                         [ 250, 100, 1 ] remoteExec [ "fnc_updateStats", _killer ];
  26.                         };
  27.                         if (_killer == commander _killerCar) then
  28.                         {
  29.                         [ 150, 100, 1 ] remoteExec [ "fnc_updateStats", _killer ];
  30.                         };
  31.                         if (_killer == crew _killerCar) then
  32.                         {
  33.                         [ 50, 50] remoteExec [ "fnc_updateStats", _killer ];
  34.                         };
  35.                     };
  36.                
  37.             }else{
  38.  
  39.                 [ -500, -100 ] remoteExec [ "fnc_updateStats", _killer ];
  40.                    
  41.                     if (_killer in _killerCar) then
  42.                     {
  43.                         if (_killer == driver _killerCar) then
  44.                         {
  45.                         [ -500, -100 ] remoteExec [ "fnc_updateStats", _killer ];
  46.                         };
  47.                         if (_killer == gunner _killerCar) then
  48.                         {
  49.                         [ -500, -100 ] remoteExec [ "fnc_updateStats", _killer ];
  50.                         };
  51.                         if (_killer == commander _killerCar) then
  52.                         {
  53.                         [ -500, -100 ] remoteExec [ "fnc_updateStats", _killer ];
  54.                         };
  55.                     };
  56.                 };
  57.            
  58.             };
  59.  
  60.         }];
  61.  
  62.     //Flag unit as having had event added
  63.     _unit setVariable [ "hasEvent", true ];
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement