Advertisement
parabola949

Untitled

Nov 18th, 2014
171
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //Fuel Pump
  2.     if(_typeOfCursorTarget in dayz_fuelpumparray) then {
  3.         if (isNil "BanditOil") then { BanditOil = 0;};
  4.         if (BanditOil > 0) then {
  5.             s_player_fuelauto = player addAction ["<t color='#ff0000'>Bandits have control of oil supply!</t>", "",[], 0, false, true, "",""];
  6.         } else {
  7.         if (s_player_fuelauto < 0) then {
  8.            
  9.             // check if Generator_DZ is running within 30 meters
  10.             _findNearestGens = nearestObjects [player, ["Generator_DZ"], 30];
  11.             _findNearestGen = [];
  12.             {
  13.                 if (alive _x && (_x getVariable ["GeneratorRunning", false])) then {
  14.                     _findNearestGen set [(count _findNearestGen),_x];
  15.                 };
  16.             } count _findNearestGens;
  17.             _IsNearRunningGen = count (_findNearestGen);
  18.            
  19.             // show that pump needs power if no generator nearby.
  20.             if(_IsNearRunningGen > 0) then {
  21.                 s_player_fuelauto = player addAction [localize "STR_EPOCH_ACTIONS_FILLVEH", "\z\addons\dayz_code\actions\fill_nearestVehicle.sqf",objNull, 0, false, true, "",""];
  22.             } else {
  23.                 s_player_fuelauto = player addAction [format["<t color='#ff0000'>%1</t>",localize "STR_EPOCH_ACTIONS_NEEDPOWER"], "",[], 0, false, true, "",""];
  24.             };
  25.         }; };
  26.     } else {
  27.         player removeAction s_player_fuelauto;
  28.         s_player_fuelauto = -1;
  29.     };
  30.  
  31.     //Fuel Pump on truck
  32.     if(_typeOfCursorTarget in DZE_fueltruckarray && alive _cursorTarget) then {
  33.         if (s_player_fuelauto2 < 0) then {
  34.             // show that fuel truck pump needs power.
  35.             if(isEngineOn _cursorTarget) then {
  36.                 s_player_fuelauto2 = player addAction [localize "STR_EPOCH_ACTIONS_FILLVEH", "\z\addons\dayz_code\actions\fill_nearestVehicle.sqf",_cursorTarget, 0, false, true, "",""];
  37.             } else {
  38.                 s_player_fuelauto2 = player addAction [format["<t color='#ff0000'>%1</t>",localize "STR_EPOCH_ACTIONS_NEEDPOWER"], "",[], 0, false, true, "",""];
  39.             };
  40.         };
  41.     } else {
  42.         player removeAction s_player_fuelauto2;
  43.         s_player_fuelauto2 = -1;
  44.     };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement