If anyone wants to fix the issue with not hiding your name from chat.
Find function meta:IsFakenamed() and put this below it (Not in the function, below the function):
local function AddFakeNameText( ply, text )
if ply:Alive() and not ply:IsSpec() and not ply:IsActiveDetective() then
chat.AddText( Color( 0, 200, 0 ),
ply:Nick(),
color_white,
": " .. text )
end
if ply:Alive() and ply:IsActiveDetective() then
chat.AddText( Color( 50, 200, 255 ),
ply:Nick(),
color_white,
": " .. text )
end
if ply:IsSpec() and not ply:IsDeadTerror() then
chat.AddText( Color( 24, 161, 35 ),
Format( "(%s) ", string.upper( "team" ) ),
Color( 200, 200, 0 ),
ply:Nick(),
color_white,
": " .. text )
end
if ply:IsDeadTerror() then
chat.AddText( Color( 255, 30, 40 ),
Format( "*%s* ", string.upper( "dead" ) ),
Color( 24, 161, 35 ),
Format( "(%s) ", string.upper( "team" ) ),
Color( 200, 200, 0 ),
ply:Nick(),
color_white,
": " .. text )
end
end
hook.Add( "OnPlayerChat", "Fake_Chatname", function( ply, text, teamchat, dead )
if IsValid( ply ) and ply:IsFakenamed() then
AddFakeNameText( ply, text )
return true
end
end )
Not sure if this is the best way to fix it, but it's the way I've found so far that works. This will work but when you're a spectator it will always say (TEAM)[fake name]: [message] regardless of whether you say it in team chat or not. Same goes for player chat it will always say [fake name]: [message] even if you use team chat (Pre round only, when you're a detective or traitor is will say what it normally says when you're unfakenamed).