ID:141017
 
Code:
    Bump(atom/O) 
if(ismob(O))
var/damage = src.dmg
usr << "You attack [O] for [damage] damage!!"
O << "[src] attack you for [damage]!!!"
O.hpdamage
O.deathcheck()
viewers(O) << "[src.owner] has hit [O:name] with \his [src]!"



mob
proc
deathcheck()
if(src.type == /mob/player)
Playerdeath()
else
range() << "[src] has been killed by [usr]!!"
del(src)
Playerdeath()
if(src.hp <= 0)
view() << "[src] died!"
src.loc = locate(1,1,1)
src.hp = maxhp
src.mana = maxmana


Problem description:
i get this error:O.deathcheck:undefined proc. i cant fix it because i dont know what is wrong, can someone tell me my mistake?

You are defining O as an /atom in the argument. You should define it as a /mob instead.

In addition, do not use usr in Bump()! You want to send it to src instead.
Try defining a mob for atom/O:

    Bump(atom/O) 
if(ismob(O))
var/mob/M = O //the mob for atom/O, then change the other O's into M's
var/damage = src.dmg
src << "You attack [M] for [damage] damage!!"
M << "[src] attack you for [damage]!!!"
M.hpdamage
M.deathcheck()
viewers(M) << "[src.owner] has hit [M.name] with \his [src]!"



mob
proc
deathcheck()
if(src.type == /mob/player)
Playerdeath()
else
range() << "[src] has been killed by [usr]!!"
del(src)
Playerdeath()
if(src.hp <= 0)
view() << "[src] died!"
src.loc = locate(1,1,1)
src.hp = maxhp
src.mana = maxmana


// Or you can do as GhostAnime says, then you don't need to use the ismob(O).
In response to Nielz (#2)
Actually, even if you change it to /mob in the argument, you still need to use ismob() since most procedures, such as Bump(), does not filter the argument.

Which means that mob/O in the argument of the Bump() proc can be a dense /turf. Defining the variable as a /mob allows you to access vars/procs defined for /mob's
usr is not safe in procs. You need to be passing a value to deathcheck() telling it who the killer was. Like so:

mob/proc/Deathcheck(var/mob/M)
view(src) << "[M] killed [src]"
del(src)

obj/bullet/Bump(mob/M)
if(ismob(M))
M.deathcheck(src.owner)


Also: view() defaults to view(usr), which is not safe in procs. So change it to view(src). Same goes for range() and oview() and such.