PHP Code:
quest got_killed begin
state start begin
when kill with npc.is_pc() begin
say("You've been killed!")
end
end
end
If you want to know, who has killed you
PHP Code:
quest got_killed begin
state start begin
when kill with npc.is_pc() begin
say("You've been killed by "..npc.get_vid())
end
end
end
but for this quest you need to patch your game with this diff-file :

[ 0x03:: npc.get_vid() ]