client/Move()
if(usr.Doing)
return
return ..()
It worked, but now it seems it just stopped working so when I do something that I have set to add 1 to doing it dosen't work.
ID:171872
![]() Jul 30 2004, 6:58 am
|
|
I asked about stopping movement before and some1 gave me this.
client/Move() It worked, but now it seems it just stopped working so when I do something that I have set to add 1 to doing it dosen't work. |
Are you setting Doing back to 0 later?
(I.E. if the action takes 30 seconds, do you have:
spawn(300) usr.Doing = 0
Or is your problem simply that the Proc doesn't stop movmement? [Edit] Oh, wait! I see a problem. Change the usr.Doing to src.Doing. Remember young one, all procs (except for a few mouse-related procs) use src instead of usr. [Edit] Another edit. Change the client to mob. Unless the Doing variable is a client variable, that is.... Or you could change the src to mob. Either way should work. |
Please do. You can always check what Doing is by simply adding world<<Doing to Move(), that way knowing if it's changing or not everytime you move.
|
client/Move() |
Looks like Doing-=1 doesn't get called because you delete the rock before you Doing gets changed.
client/Move() I think that should fix it all up, just post again if there's trouble. |
obj I'm getting an error at the src.mined for iron that says missing expression |
I see the problem, you accidently added a space to it. It's tabbed correctly, but check carefully, you have a space in it.
|
mob/var/Doing=0
obj/var/Mined=0 mob/Move() if(src.Doing==0) ..() obj Rock_CopperIron name = "Rock" icon = 'rocks.dmi' icon_state = "1" density = 1 opacity = 1 Mined = 0 verb Mine() set src in oview(1) var/obj/pickaxe = locate(/obj/pickaxe) in usr.contents if(pickaxe) usr.Doing = 1 if(prob(35 + usr.luck)) spawn(300) usr.contents+=new/obj/copper usr << "You find copper!" src.Mined += 1 if(prob(25 + usr.luck)) spawn(300) usr.contents+=new/obj/iron usr << "You find iron!" src.Mined += 1 else spawn(100) usr << "You find nothing!" src.Mined += 1 usr.Doing -=1 usr.exp += 50 Exp(usr) if(Mined>5)del src else usr << "You have no pickaxe!" |
Whenever you want to halt, allow, or toggle between the two, change Doing to either 1 or 0.