Replace disconnected-message on custom gamemode

Alright… I’ve started working on my own gamemode and ran into an issue. I want to remove the standard disconnect-message “Player Jompe left the game (Disconnect by user.)” and replace it with something else. I’ve tried this:



util.AddNetworkString("PlayerDisconnected")

function GM:PlayerDisconnected( ply )
	net.Start("PlayerDisconnected")
	net.WriteString(ply:Name())
	net.Broadcast()
end

a simple way:



function GM:PlayerDisconnected( ply )
for k, v in pairs(player.GetAll()) do
v:Print(ply:Nick())
end
end


not sure if this is the best fix but its one that works

Problem was resolved by doing:


hook.Add( "ChatText", "hide_joinleave", function( index, name, text, typ )
	if ( typ == "joinleave" ) then return true end
end )