Ulysses
Ulysses Stuff => General Chat & Help and Support => Topic started by: Willdy on August 22, 2011, 05:24:48 PM
-
Has this been developed at all? A small ULX addon which would put the group of a player before his name in chat.
[Admin] Willdy
Shouldn't be to hard to make, but it would be nice :o
-
Modifying chat is a can of worms, which is part of the reason we don't do this. It's unlikely that we'll ever support this in mainline ULX because of all the potential problems it raises.
-
Ugly, Untested, and Unsupported
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 true
end
hook.Add( "OnPlayerChat", "PlayerChatTeamPrefix", lOnPlayerChat )
Set this up to run on the client side.
Yay, I'm contributing again :D. That was fun.