script_properties("work-in-pause")
local sampev = require("samp.events")
function main()
while not isSampAvailable() do wait(100) end
wait(-1)
end
function sampev.onPlayerDeathNotification(killerId, killedId, reason)
local result, myId = sampGetPlayerIdByCharHandle(PLAYER_PED)
if not result then return end
if killedId ~= myId or killerId == 65535 then return end
local name = sampGetPlayerNickname(killerId)
local message = string.format("killer name: %q", name)
sampAddChatMessage(message, -1)
print(message)
end