Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- 1: put this file in lua/autorun/
- -- 2: Edit this to match the file name
- local filename = "chatranks.lua"
- if SERVER then
- AddCSLuaFile( "autorun/" .. filename )
- else
- local function ChatTags( Ply, Txt, TeamChat, IsDead )
- local Msg = {}
- -- Dead?
- if IsDead then
- Msg[#Msg+1] = Color( 255, 30, 40 )
- Msg[#Msg+1] = "*DEAD* "
- end
- -- Team Chat
- if TeamChat then
- Msg[#Msg+1] = Color( 30, 160, 40 )
- Msg[#Msg+1] = "(TEAM) "
- end
- -- Rank
- if Ply:IsSuperAdmin() then
- Msg[#Msg+1] = Color( 255,255,255 )
- Msg[#Msg+1] = "[Super Admin] "
- elseif Ply:IsAdmin() then
- Msg[#Msg+1] = Color( 255,255,255 )
- Msg[#Msg+1] = "[Admin] "
- end
- -- Console?
- if IsValid( Ply ) then
- Msg[#Msg+1] = team.GetColor( Ply:Team() )
- Msg[#Msg+1] = Ply:Nick()
- else
- Msg[#Msg+1] = Color( 100, 100, 100)
- Msg[#Msg+1] = "Console"
- end
- -- The message
- Msg[#Msg+1] = Color(255,255,255)
- Msg[#Msg+1] = ": " .. Txt
- chat.AddText( unpack(Msg) )
- return true
- end
- hook.Add("OnPlayerChat","Simple chat tags",ChatTags)
- end
Add Comment
Please, Sign In to add comment