mirror of
https://github.com/etlegacy/etlegacy-lua-scripts.git
synced 2024-11-26 06:11:49 +00:00
c0a6dac4b1
Added modname and version to show it with /lua_status
19 lines
771 B
Lua
19 lines
771 B
Lua
--Source: http://lua.wolffiles.de/?fileid=32
|
|
modname="AnnounceHP"
|
|
version="1.0"
|
|
|
|
function et_InitGame()
|
|
et.RegisterModname(modname.." "..version)
|
|
end
|
|
|
|
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
|