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.
ID:267644
Aug 8 2003, 7:50 am
|
|
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> |
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.