Blocking ChatText Type JoinLeave

Is there a way to filter what is placed in the default chatbox by the server? I have tried the code below but it does not seem to hide player joinleaves, also need this to work for ban and kick text.

[lua]
function HideJoinLeave( playerindex, playername, text, messagetype )
if messagetype == “joinleave” then
return false
end
end
hook.Add( “ChatText”, “HideJoinLeave”, HideJoinLeave )
[/lua]

[del]Use **[Gamemode.PlayerSay

http://wiki.garrysmod.com/favicon.ico](wiki.garrysmod.com/?title=Gamemode.PlayerSay)** instead.[/del]

Misunderstood the problem.

[lua]
hook.Add(“PlayerInitialSpawn”, “kk”, function( ply )
timer.Simple( 2, function()
if ply:IsValid() then
ply:ConCommand(“wait 1;cl_chatfilters 30”)
end
end )
end )
[/lua]

Works but seems to also block my chat.AddText which is hooked onto playerconnect. I really should make a custom chat but a lot of people are hush hush about it and I have tried many times but always fail.

Edit: Very tard moment, got it sorted out.