local complete = false;

function Buttons_T(sender,obj_id)
ButtonTreatment(obj_id,10001,10002,10003,CloseBtnX,CloseBtnY,34,34,sender,"vhod_turmy",false)     
end;

function gameinput (sender,obj_id,attachedID)    
CursorTreatment(obj_id,sender,attachedID);
Buttons_T(sender,obj_id)

  if sender == 30 then
      DeleteResource("kusty2");
      DeleteResource("kusty02");
      DeleteResource("kusty1");  
      DeleteResource("kusty11");     
      DeleteResource("dizel");         
    setcurentleaf("vhod_turmy",13,0);    
    DarkScreen(false);
    Block_Show_Cur(false);
    if flags.kusty then
      ActivateObject(6,false);
      Set_Anim_Cur(6,3);
      StopEmiter("kusty");
    end;
  return;end;
  
  if sender==50 then
        Block_Show_Cur(true);
        StartTimer(8882,0.5);
  return;end;
  
  if sender == 1 then
    if obj_id == obj.solra.id then
      if flags.grass_cut then
        RemObjFromMouse()
        StoreObj(obj.solar.id,obj_id,"380",285,350,"dizel",323,217)
        UnStoreObj(obj.sadnog.id);
      return; end;
    return; end;
    if obj_id == 6 or obj_id == 9 then
      if obj.sadnog ~= nil and attachedID == obj.sadnog.id then
        cut_object=obj_id
        Block_Show_Cur(true);
        playeffect("sad");
        speciale_action(2,5,true);
      return; end;
      if attachedID~=-1 and ((obj.sadnog~=nil and attachedID ~= obj.sadnog.id) or (obj.sadnog==nil ))  then
        RemObjFromMouse()      
        CreatePlashechka(900000,"1000")
      return;end;      
        CreatePlashechka(900000,"381")      
    return; end;    
    
    

  return ;end;
  
  if sender == 16 then
    if obj_id == 5 then
      speciale_action(2,4,true,2);
      speciale_action(2,5,true,1.7);  
    return; end;
    if obj_id == 4 then
       speciale_action(2,4,true,1.7);       
       if not flags.cut_7 then
        speciale_action(2,5,true,2);
        playeffect("sad");
        speciale_action(2,6);
        flags.cut_7=true;
       return;end;
       if flags.cut_7 and not flags.cut_9 then
        speciale_action(2,9);
        flags.cut_9=true;
       end;      
       if flags.cut_9 and flags.cut_7 then
        RemObjFromMouse()
        UnStoreObj(obj.sadnog.id);
        flags.grass_cut=true;
        speciale_action(10,6)
        speciale_action(10,8)
        speciale_action(10,7)
        speciale_action(10,9)        
        Set_Anim_Cur(7,3);    
        Set_Anim_Cur(9,3);
        Set_Anim_Cur(obj.solra.id,4);      
        Block_Show_Cur(false);        
       end;           
    return; end;
  return; end;

  if sender == 36 then
    if obj_id == 8882 then
      flags.kusty = true; 
      clear_satelite_leaf("vhod_turmy");
    return; end;
    if obj_id==676767676 then
        speciale_action(2,5,true);
    return;end;
  return; end;
  

end
function SheetSwitched(nCount)
end;