ID:262443
 
Problem description:
I don't know the forumla to exactly get the Meter to get an icon_State depedning on the players Stamina.

BTW the icon as 10 icon states.
Code:
mob
Player

var
MaxStamina = 5
Stamina = 5
obj
Meters
layer = MOB_LAYER + 16
Stamina
icon = 'Meter 1.dmi'
icon_state = "0"
screen_loc = "1,1"
New()
..()
spawn(5) src.Update()
proc
Update()
while(src)
sleep(10)
src.icon_state = round(usr.Stamina/usr.MaxStamina*10)




Look at the demo.

--Vito
I'm not entirely to sure if your code will actually work, even with the proper equation. But with my own Life/Mana bar coding, here's the equation I use :
var/Check = src.Hp *100
var/Check2 = Check / src.MHp
if(Check2 >= 91)
//In your case the icon state of the meter would be the max.
else
if(Check2 >= 81)
//Just continue this format.


This is what I use for the Health overlay bar in my game, and it works flawlessly.
In response to FinalFantasyFreak
Its ok, I already fixed it. Thanks though ^_^.