TTT - Notifying about a karma banned in chat

Karma bans by defualt are issued without notifying anyone but the victim.

Is there a way to have a notification about someone being karma banned in chat?

Print the message here instead of just logging it: https://github.com/garrynewman/garrysmod/blob/f9f8ebe5341a5f69191dbef4c86b532e534c60a8/garrysmod/gamemodes/terrortown/gamemode/karma.lua#L337

Not too great with Lua, am i making a Print line?

Just do as code gs said, use any function that prints it to the chat, eg using a for loop that uses PrintMessage on every player, or chat.addtext.

Would this work?:


 ServerLog(ply:Nick() .. " autokicked/banned for low karma.
")
	  chat.AddText ply:Nick() .. "was karma banned." )


thehell no, you are missing an (, and the file is serverside, so you’d have (as I said…) make a for loop that does that…


for _, ply in ipairs( player.GetAll() ) do
   ply:PrintMessage( "message here" )
end



hook.Add("TTTKarmaLow", "NotifyForKarmaBan", function(ply)
	PrintMessage( HUD_PRINTTALK, "Player '" .. ply:Nick() .. "' has been banned for low karma." )
end)


http://ttt.badking.net/guides/hooks
http://wiki.garrysmod.com/page/Global/PrintMessage

Placed it right beneath


 ServerLog(ply:Nick() .. " autokicked/banned for low karma.
")

And it didnt work. Just to remind you, I am not good with lua, that’s why i came here to learn and get help.

EDIT: tried a 2nd time and it worked

you just could’ve made an addon instead of overwriting core files, duh >-<

There’s no hook for that section.