ID:148566
 
Whats rong with this ? code it Saids no proc inside another
proc alowed can some one her me please Thank you



Deathcheck()
if(src.hp <= 0)
if(istype(src.client))
src << "You have died, by [usr]"
usr << "You killed [src]"
src.loc = locate(1,1,1)
src.attacked = 0
else
usr.exp += src.expgive
usr.gold += src.goldgive
src.attacked = 0
usr << "You have killed [src]!"
del(src)
else
..()
mob/proc/Deathcheck(mob/M, var/killer)
if(M.hp <= 0)
if(istype(M.client))
src << "You have died, by [killer]"
usr << "You killed [M]"
src.loc = locate(1,1,1)
src.attacked = 0
else
usr.exp += src.expgive
usr.gold += src.goldgive
src.attacked = 0
usr << "You have killed [M]!"
del(src)
First you need to have it mob/proc second src won't do you any good. the last else ..() won't do anything because you cannot check if it is a client or not with mob/M.

In your attack code when you call deathcheck do this...
Deathcheck(M,usr)
<code>mob proc Deathcheck( var/mob/Killer ) if( src.hp <= 0 ) src.attacked = 0 Killer << "You have killed [src]!" if( src.client ) src << "You have died, by [Killer]" src.loc = locate(1,1,1) else Killer.exp += src.expgive Killer.gold += src.goldgive del(src) </code>
In your attack event, you need to call deathcheck for the person being attacked, and the parameter you have to send it is the mob that is attacking.
In response to OneFishDown
Just a minor note, it can be "mob/Killer" instead of "var/mob/Killer" in the argument, it saves typing.