The international community has committed hundreds of millions of dollars to train Afghan police in destroying laboratories and opium crops , as well as to fund projects to help farmers grow legal crops .