Could you perhaps mean anything like this? It looks to me like you are using a very complex code for a very simple task.
thanks for this. but i don't want the health bar on top of my character. here's the link to know more what im saying. the healthbar and ammo stays on its place(i adjust the room with). http://madebyluke.com/gamedesign/tutorials/tut_draw_percentage_bar.html