ID:267644
 
i need to know how to make it so when i use a rest() in my game they cant mover while they are sleeping. how would i do that.
you could do it several ways(I think), ill give you a long way:
client
North()
if(sleep = 1)
return
South()
if(sleep = 1)
return
East()
if(sleep = 1)
return
West()
if(sleep = 1)
return
Northeast()
if(sleep = 1)
return
Northwest()
if(sleep = 1)
return
Southwest()
if(sleep = 1)
return
Southeast()
if(sleep = 1)
return

mob/var/sleep

and in the verb sleep make sleep = 1 and when they wake up make it 0.
In response to Cloudiroth
A shorter way than doing all that client/North() stuff is to override client/Move(). If you want NPCs to sleep as well, override mob/Move instead.

<code>client/Move() if (mob.sleep) then return 0 //Cancel movement if sleeping .=..() //Do the movement like you normally would</code>

Or...

<code>mob/Move() if (src.sleep) then return 0 //Cancel movement if sleeping .=..() //Do the movement like you normally would</code>