WP Admin Messages Hook

<?php

function print_message($message,$is_error = false){
if($is_error) echo '<div id="message" class="error">';
else echo '<div id="message" class="updated fade">';
echo "<p><strong>$message</strong></p></div>";
}

function message_config(){
print_message('This is an Error',1);
print_message('This is a Warning');
}

if(!get_option('myoptionname')) add_action('admin_notices','message_config');

?>