Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ------------------------------------
- -- This file holds the chat tags --
- -------------------------------------
- if ( SERVER ) then
- AddCSLuaFile( )
- return
- end
- if ( CLIENT ) then
- local string = string
- local str = string
- local str2
- local TagColor = {}
- --TagColor["YourCustomUsergroupNameHere"] = Color( red, green, blue )
- TagColor["Owner"] = Color( 127, 0, 255 )
- TagColor["Co-Owner"] = Color( 127, 0, 255 )
- TagColor["Head Admin"] = Color( 0, 0, 204 )
- TagColor["Super Admin"] = Color( 255, 0, 0 )
- TagColor["Admin"] = Color( 255, 128, 0 )
- TagColor["Moderator"] = Color( 178, 102, 255 )
- TagColor["Developer"] = Color( 255, 0, 0 )
- TagColor["VIP"] = Color( 255, 255, 0 )
- local function OnPlayerChat( ply, strText, bTeamOnly, bPlayerIsDead )
- local tab = {}
- local defcol = Color( 0, 201, 0 )
- 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
- if ( ply.GetUserGroup ) then
- if ( ply:GetUserGroup() ~= "user" ) then
- table.insert( tab, TagColor[ ply:GetUserGroup() ] or Color( 255, 255, 255 ) )
- str = ply:GetUserGroup()
- str2 = str
- if string.find( str2, "%s" ) then
- string.sub( str2, string.find( str2, "%s" ), string.len( str2 ) )
- str2 = str2:gsub( "^%l", string.upper )
- end
- str = str:gsub( "^%l", string.upper )
- table.insert( tab, "[" .. str .. "] " )
- end
- end
- table.insert( tab, defcol )
- 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", "Tags.OnPlayerChat", OnPlayerChat )
- end --End clientside
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement