mob/Move()
if(src.client)
if(!src.Rank == "Administrator"||!src.Rank == "Moderator")
if(src.Hunger < 100)
var/varHunger = pick(0,0,0,0,1)
if(varHunger == 1)
src.Hunger += pick(0,0,0,0,1)
if(src.Hunger >= 90)
var/varHungerDamage = pick(0,0,0,0,1)
if(varHungerDamage == 1)
src.HP -= rand(1,5)
usr << "[MessageOp]You lose health from lack of food!"
if(src.HP <= 0)
usr << "[MessageOp]You die of starvation!"
oview(8) << "[MessageOp][src.name] dies of starvation!"
src.HP = src.MaxHP
src.MP = src.MaxMP
src.Hunger = 0
src.loc = locate(33,14,1)
everything works fine, except when you die you dont go back to the set spot. what am i doing wrong? i don't get any run-time errors or anything, it just simply does not move me back to the 33,14,1 area.
thanks
Daniel</100>
ID:173216
![]() Feb 2 2004, 12:52 am
|
|
Anyways if someone gets that message (You die of starvation!") then there is something wrong after that part.
put // infront of the "oview(8) << "[MessageOp][src.name] dies of starvation!"" line and check again, otherwise i dunno what could be wrong. (never used the oview() stuff that way, but my guess is that it wont cause any problems)
If you dont get that message (You die of blabla)there is something wrong in the other part, src.HP aint <= 0 then so you just have to check trough the code.
Something that always helps me, just read a line, say what the code will do, what change are there in the vars and read the next line and do the same over and over untill you read your whole code (that could be wrong). This way you often strumble across something thats is wrong but wont give you a runtime error.
Goooood luck,
Greetz Fint