You need to redraw it when the ammo count changes, but I can't help you with that since I don't know the context.
However, a brute force solution can look like this:
PHP Code:
//#CLIENTSIDE
function onCreated()
{
setTimer(.5);
}
function onTimeout()
{
hideimgs(200, 300);
for (i=1; i<client.ammo; i+=1)
{
showimg(200+i, "mercia_newgui.png", screenwidth - 302 -(i*4), screenheight - 75);
changeimgpart(200+i, 220, 137, 5, 10);
changeimgvis(200+i, 5);
}
setshape(1, 32, 32*client.ammo);
setTimer(0.05);
}