local need_all = 0;

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

function gameinput (sender,obj_id,attachedID)
Buttons_T(sender,obj_id)
CursorTreatment(obj_id,sender,attachedID);    
  if sender == 30 then
      DeleteResource("koleso2");
      DeleteResource("koleso3");
      DeleteResource("koleso_all");         
      DeleteResource("koleso8");    
    setcurentleaf("parom",9,0);    
    Block_Show_Cur(false);
    if flags.koleso then
      speciale_action(2,24);
      StopEmiter("bcol");
    end;
  return;end;
  
  if sender == 1 then

    
    if obj_id == 8 then
      if obj.bagor ~= nil and attachedID == obj.bagor.id then
        RemObjFromMouse()
        UnStoreObj(attachedID);
        Block_Show_Cur(true);
        Set_Anim_Cur(8,3)
        playeffect("bagor")
        speciale_action(2,7,true);
      return; end;
      if attachedID~=-1 and ((obj.bagor~=nil and attachedID ~= obj.bagor.id) or (obj.bagor==nil ))  then
        RemObjFromMouse()
        CreatePlashechka(900000,"1000")
      return;end;
        CreatePlashechka(900000,"207")      
    return; end;
    
  return ;end;
  
  if sender == 16 then
    if obj_id == 7 then
      speciale_action(2,8,true,2);
      speciale_action(2,7,true,2);
      speciale_action(2,5,true,2);
      speciale_action(2,6,true,2);
    return; end;
    if obj_id == 6 then
      speciale_action(2,5,true,2);
      speciale_action(2,6,true,2);
        StartTimer(8882,3);
    return; end;    
  return; end;
  
  if sender == 100 then

  return; end;
  
  if sender==50 then
      clear_satelite_leaf("parom");
  return;end;
  
  if sender == 36 then
    if obj_id == 8882 then
      Block_Show_Cur(false);
      flags.koleso = true;
      StoreObj(obj.koleso.id,nil,"206",285,350,"kolesa",323,217)    
    return; end;
  return; end;
  
end
function SheetSwitched(nCount)
end;