Advertisement
King_ZZ

ChainSaw.lua_SNIPPET_SetRunning

Nov 18th, 2019
165
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.04 KB | None | 0 0
  1.     if self.saw.isActive and self.controller == g_currentMission.player and g_gui.currentGui == nil then
  2. -- Add in to the if statement a way of checking the field has been purchased as to not cut down trees within that field
  3.         if self.saw.fuelFillLevel > 0 then
  4.             if InputBinding.isPressed(InputBinding.SETSAWRUNNING) then
  5.                 if not self.saw.isRunning then
  6.                     self:setSawIsRunning(true);
  7.                 end;
  8.             else
  9.                 self:addHelpButtonTextWithCorrectMouseButtons("SETSAWRUNNING", InputBinding.SETSAWRUNNING, "set_saw_running");
  10.                 if self.saw.isRunning then
  11.                     self:setSawIsRunning(false);
  12.                 end;
  13.             end;
  14.         else
  15.             g_currentMission:addExtraPrintText(g_i18n:getText("fillSawInfo"));
  16.         end;
  17.            
  18.         if InputBinding.isPressed(InputBinding.SETSAWTURNING) then
  19.             if not self.saw.isTurning then
  20.                 self:setSawIsTurning(true);
  21.             end;
  22.         else
  23.             self:addHelpButtonTextWithCorrectMouseButtons("SETSAWTURNING", InputBinding.SETSAWTURNING, "turn_saw");
  24.            
  25.             if self.saw.isTurning then
  26.                 self:setSawIsTurning(false);
  27.             end;
  28.         end;
  29.     end;
  30. end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement