Editing kill notices.

I’ve been trying to figure out how to edit the kill notifications that pop up in the top right of your screen when you die/get killed, I’ve been trying to figure it out for a while, but can’t seem to get around to it. And the only thing I’ve found online is:


function GM:PlayerDeath( victim, inflictor, attacker )
	if ( victim == attacker ) then
		PrintMessage( HUD_PRINTTALK, victim:Name() .. " committed suicide." )
	else
		PrintMessage( HUD_PRINTTALK, victim:Name() .. " was killed by " .. attacker:Name() .. "." )
	end
end

This prints it into the chatbox, but I don’t want it to print into chat box, just want it to kinda appear on screen, I’m just wondering how I’d start something like this, or if there are any examples or anything, I know this isn’t the place for people to do the code, just want a starter of how to actually do it, and to make it appear on a players screen instead of the players chatbox, as it’d look messy.

You could try



notification.AddLegacy


Gave it try, most probably done it completely wrong, comes up with "attempt to index global ‘notification’ "

But like I said, most probably tried doing it wrong:


function GM:PlayerDeath( victim, inflictor, attacker )
	if ( victim == attacker ) then
		notification.AddLegacy( victim:Name() .. " committed suicide.", NOTIFY_UNDO, 5 )
	else
		notification.AddLegacy( victim:Name() .. " was killed by " .. attacker:Name() .. ".", NOTIFY_UNDO, 5 )
	end
end

Its because notification.AddLegacy is clientside and youre running it serverside. Use net messages or usermessages.

GM/AddDeathNotice

GM/DrawDeathNotice