Instead of using the number 3, you get the current category by doing the following:
$cat_ID = get_query_var('cat');
$posts = get_posts('cat=".$cat_ID."&numberposts=5&offset=0');
Instead of using the number 3, you get the current category by doing the following:
$cat_ID = get_query_var('cat');
$posts = get_posts('cat=".$cat_ID."&numberposts=5&offset=0');