diff --git a/README.md b/README.md index c84d1d7..fcbbd44 100644 --- a/README.md +++ b/README.md @@ -34,4 +34,8 @@ Lua scripts for the Legacy mod ## ladm - lightweight administration suite * NOTE: not even alpha state. Do not use. -* manage users on your server \ No newline at end of file +* manage users on your server + +## announcehp + +* Killer's HP is displayed to their victims. diff --git a/announcehp/announcehp.lua b/announcehp/announcehp.lua new file mode 100644 index 0000000..c991286 --- /dev/null +++ b/announcehp/announcehp.lua @@ -0,0 +1,12 @@ +--Source: http://lua.wolffiles.de/?fileid=32 +function et_Obituary(victimnum, killernum, meansofdeath) + local victimteam = tonumber(et.gentity_get(victimnum, "sess.sessionTeam")) + local killerteam = tonumber(et.gentity_get(killernum, "sess.sessionTeam")) + if victimteam ~= killerteam and killernum ~= 1022 then + local killername = string.gsub(et.gentity_get(killernum, "pers.netname"), "%^$", "^^ ") + local killerhp = et.gentity_get(killernum, "health") + --this sends a message to the client only + msg = string.format("cpm \"" .. killername .. "^7 had^o " .. killerhp .. " ^7HP left\n") + et.trap_SendServerCommand(victimnum, msg) + end +end