ID:146339
 
Code:
      rest
icon='clientscreen.dmi'
icon_state = "rest"
layer = MOB_LAYER + 5
Click()
if(src.rest == 1)
usr << "You stop resting"
src.rest = 0
return
else
usr << "You start Resting"
src.rest = 1
usr.Resting()
return
New(client/C)
screen_loc = "5,1"
C.screen+=src
//My proc
Resting()
if(src.rest == 1)
if(src.kitrain == 1||src.spartrain == 1)
usr<<"\yellow<center>You need to stop training to use this!"
src.rest = 0
return
else
src.icon_state = "meditate"
sleep(10)
src.stamina += rand(1,4)
if(src.stamina <= 100)
src.stamina = 100
src.rest = 0
usr << "\yellow <center> You stopped Resting"
return
else
usr.Resting()
return


Problem description:
When I'm in the game, it doesn't call the Resting Proc. What did I do wrong.
Usr abuse, perhaps?
I found the problem, you're setting the obj's rest to 1 instead of the player's. Ideas:
use if(var) instead of if(var==1)
use if(!var) instead of if(var==0)
know what the src and usr is, and the difference
In response to Ol' Yeller
Thanks I got it fixed now.

I decided to make the hud part into a proc and make the hud part just call that proc.