0 Members and 2 Guests are viewing this topic.
local function lOnPlayerChat( ply, strText, bTeamOnly, bPlayerIsDead ) local tab = {} local lTeam = 0 if( IsValid( ply ) ) then lTeam = ply:Team() end table.insert( tab, Color( team.GetColor( lTeam ) ) ) table.insert( tab, "[" .. team.GetName( lTeam ) .. "] " ) if ( bPlayerIsDead ) then table.insert( tab, Color( 255, 30, 40 ) ) table.insert( tab, "*DEAD* " ) end if ( bTeamOnly ) then table.insert( tab, Color( 30, 160, 40 ) ) table.insert( tab, "(TEAM) " ) end if ( IsValid( ply ) ) then table.insert( tab, ply:GetName() ) else table.insert( tab, "Console" ) end table.insert( tab, Color( 255, 255, 255 ) ) table.insert( tab, ": "..strText ) chat.AddText( unpack(tab) ) return trueendhook.Add( "OnPlayerChat", "PlayerChatTeamPrefix", lOnPlayerChat )