In Bereshit 4:4, Hevel offers his choicest sheep as a sacrifice to G-d.
However, in Bereshit 1:29-30, Adam is told he is only allowed to eat vegetables, and Rashi explains that he was forbidden to kill meat (There are different opinions about what exactly is forbidden, but the Mizrachi explains that Rashi is saying that Adam was forbidden to kill living things - see here as wellhere as well). Later, G-d gave Noach permission to kill and eat meat.
If Hevel was not allowed to kill meat, how was he allowed to offer an animal as a sacrifice?