Hackers Mission

Hackers Mission

« posted: Dec 21, 2017, 10:33 PM »
looking for a piece of code that will prevent money being taken from members of the same group's bank accounts.

Currently members in the same independent group lose money from there bank accounts when the hackers is completed from a member in the same group, not ideal..

// Give Reward to the hacker
      _totalMoney = 0;
      _playerSide = side player;
      switch (_playerSide) do {
      
   case BLUFOR:
   {   
      {   
         if (isPlayer _x) then {
         if  (side _x == BLUFOR) then {}
         else {
         _bmoney = _x getVariable ["bmoney",0];
         if ( _bmoney > 0 ) then { //might as well check for zero's
         _fivePercent = round(0.035*_bmoney);
         _x setVariable [ "bmoney", (_bmoney - _fivePercent), true ];
         [] spawn fn_savePlayerData;
         _totalMoney = _totalMoney + _fivePercent;
      }
         }
            }
      } forEach playableUnits;
   };
   
   case OPFOR:
   {   
      {   
         if (isPlayer _x) then {
         if  (side _x == OPFOR) then {}
         else {
         _bmoney = _x getVariable ["bmoney",0];
         if ( _bmoney > 0 ) then { //might as well check for zero's
         _fivePercent = round(0.035*_bmoney);
         _x setVariable [ "bmoney", (_bmoney - _fivePercent), true ];
         [] spawn fn_savePlayerData;
         _totalMoney = _totalMoney + _fivePercent;
      }
         }
            }   
      } forEach playableUnits;
   };       
   default
   {
      {   
         if (isPlayer _x) then {
         _bmoney = _x getVariable ["bmoney",0];
         if ( _bmoney > 0 ) then { //might as well check for zero's
         _fivePercent = round(0.035*_bmoney);
         _x setVariable [ "bmoney", (_bmoney - _fivePercent), true ];
         [] spawn fn_savePlayerData;
         _totalMoney = _totalMoney + _fivePercent;
      }
         }
      } forEach playableUnits;
   
         };
                     };
         
         if (_totalMoney > 1850000) then {
         player setVariable ["cmoney", (player getVariable ["cmoney", 0]) + _totalMoney, true];
         [] spawn fn_savePlayerData;
         systemChat format["You have hacked players bank accounts to the value of $%1",_totalMoney];   
         }
      else    {
         player setVariable ["cmoney", (player getVariable ["cmoney", 0]) + 1850000, true];
         [] spawn fn_savePlayerData;
         systemChat format["You have hacked players bank accounts to the value of $1.250.000"];            
            };
         };
               
         ctrlSetText [ 8002, format [ "%1 kb/s", _dlRate ] ];      
         ctrlSetText [ 8004, format [ "%1 kb", _newFile ] ];            
         
         sleep 1;
      };
      
      T8_varDiagAbort = false;
      
      closeDialog 0;

      _laptop setVariable [ "InUse", false, true];   
   };
};

downloadDataDONE = true;



this is the code from the hacking of the laptop, need to change it so it doesnt take money from members of the same group.

thanks