obj/Bullet/Bump(mob/M)
if(ismob(M))
M.die()
i get an error that says undefined proc. any ideas?
ID:148520
![]() Jan 13 2003, 12:29 pm
|
|
obj
bullet Bump(mob/M) if(ismob(M)) M.die() icon = 'projectile.dmi' icon_state = "bullet" New(mob/owner) ..() walk(src,owner.dir) sleep(10) del src ok, there's the full code....what do you think now? |
I think that it's not the full code. Do you, or do you not have a <code>mob/proc/die()</code> proc? If you don't, there's your problem. If you do, let's see it.
|
now that you mention it...i don't have the die() proc. i tired making one but i seriously can't get it to work... =(
|
EnjoiStaticX wrote:
now that you mention it...i don't have the die() proc. Well no wonder you're getting an "undefined proc" error! :-D i tired making one but i seriously can't get it to work... =( It's really not all that hard: <code>mob/proc/die(mob/killer) if (killer==src) world << "[src] committed suicide" else world << "[killer] kills [src]" del src</code> That's a very basic example; all it does is tell everyone about the death, and who caused the death. Just remember to pass the mob who killed src to die() when you call it, and you're set! You can add anything else you want in there - you could respawn players instead of deleting them, place blood/bodies, give the killer an experience bonus, etc. |
Don't forget you need
if(!killer) if the killer no longer exists when the die() proc is called. |
EnjoiStaticX wrote:
obj I think you set up New() wrong; the owner of the bullet should be the second argument. The first argument is the location of the bullet. Also, you're calling sleep() instead of spawn() here, which doesn't seem like a good idea. obj/bullet Lummox JR |
Then there is no /mob/proc/die... we'd have to see more code, that's all I can tell you. Do you have:
mob/
proc/
die()
// Commands
Note that if it is /mob/player/proc/die, it wont work.