local gotovo = false;
function Buttons_T(sender,obj_id)
    ButtonTreatment(obj_id,10001,10002,10003,CloseBtnX,CloseBtnY,34,34,sender,"police",false)     
end; 

function gameinput (sender,obj_id,attachedID) 
Buttons_T(sender,obj_id)
CursorTreatment(obj_id,sender,attachedID);
  if sender == 30 then
      DeleteResource("kanistr_police1");
      DeleteResource("rew_big");
      DeleteResource("kanistr_police8");    
      DeleteResource("kanistra");  
    setcurentleaf("police",4,0);
    if flags.rew_raspil and not flags.rew_raspilM then
    flags.rew_raspilM=true;
      speciale_action(2,18);
      speciale_action(2,20);       
    end;
    Block_Show_Cur(false);
    if flags.kanistra then
      if not flags.rew_raspilM then
      flags.rew_raspilM=true;
      speciale_action(2,18);
      speciale_action(2,20);
      end;
      speciale_action(2,26);
      StopEmiter("kanistra");
    end;
  return;end;
  
  if sender==50 then
         StartTimer(8882,0.5);
        Block_Show_Cur(true); 
  return;end;
  
  if sender == 1 then

    if obj_id == 8 then
      if obj.napiln ~= nil and attachedID == obj.napiln.id then
        RemObjFromMouse()
        UnStoreObj(attachedID);
        flags.rew_raspil=true;
        Block_Show_Cur(true);
        Set_Anim_Cur(8,3)
        speciale_action(2,5,true);
      return; end;
      if attachedID~=-1 and ((obj.napiln~=nil and attachedID ~= obj.napiln.id) or (obj.napiln==nil ))  then
        RemObjFromMouse()
        CreatePlashechka(900000,"1000")
      return;end;          
      CreatePlashechka(900000,"316")
    return; end;
    if obj_id == obj.knstor.id then
      if flags.gotovo then
        RemObjFromMouse()
        flags.kanistra = true;
        StoreObj(obj.knstro.id,obj_id,"315",335,350,"kanistra",291,239)
      return; end;
      CreatePlashechka(900000,"316")
    return; end;
  return ;end;
  
  if sender == 16 then
    if obj_id == 5 then
      counter=counter+1;
      playeffect("napilnik")
      speciale_action(2,6,true,1);
      speciale_action(2,5,true,0.7);
    return; end;
    if obj_id == 6 then
      if counter>3 then
          speciale_action(2,4,true);
          speciale_action(2,6,true)
          speciale_action(2,8,true);
          Set_Anim_Cur(obj.knstor.id,4);
          flags.gotovo = true;
          Block_Show_Cur(false);
      return;end;
      counter=counter+1;
      speciale_action(2,6,true,0.7);
      speciale_action(2,5,true,1);      
    return; end;
  return; end;

  if sender == 36 then
    if obj_id == 8882 then
      Block_Show_Cur(false);
      
      clear_satelite_leaf("police");
    return; end;
  return; end;

end
function SheetSwitched(nCount)
end;