Advertisement
Guest User

Untitled

a guest
Dec 6th, 2016
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.04 KB | None | 0 0
  1. if SERVER then
  2. AddCSLuaFile( "tags.lua" )
  3. end
  4.  
  5. local cWhite = Color( 255, 255, 255 )
  6. local cBlack = Color( 0, 0, 0 )
  7. local cRed = Color( 255, 0, 0 )
  8. local cGreen = Color( 0, 255, 0 )
  9. local cBlue = Color( 0, 0, 255 )
  10. local cLightBlue = Color( 0, 255, 255 )
  11. local cLightGreen = Color( 04, 255, 51 )
  12. local cOrange = Color ( 245, 184, 0 )
  13. local cPurple = Color ( 184, 0, 245 )
  14. local cLightPurple = Color ( 204, 51, 255 )
  15. local cCyan = Color ( 51, 255, 204 )
  16.  
  17. local CTags = {}
  18.  
  19. -- CTags[Number] = { "Tag of group", "group-name", Color( of, the, tag ) }
  20. CTags[1] = { "[Owner]", "owner", cRed }
  21. CTags[2] = { "[Admin]", "admin", cGreen }
  22. CTags[3] = { "[TrialAdmin", "trialadmin", cLightGreen}
  23. CTags[4] = { "[User]", "user", cWhite }
  24. CTags[5] = { "[Trusted]", "trusted", cLightBlue }
  25. CTags[6] = { "[HeadAdmin]", "headadmin", cOrange }
  26. CTags[7] = { "[Moderator]", "mod", cPurple}
  27. CTags[8] = { "[TrialMod]", "trialmod", cLightPurple}
  28. CTags[9] = { "[SuperAdmin], "super admin" cCyan}
  29.  
  30.  
  31. local function ChatTags( a, b, c, d )
  32.  
  33. local C = {}
  34.  
  35. if d then
  36. table.insert( C, Color( 255, 30, 40 ) )
  37. table.insert( C, "*DEAD* " )
  38. end
  39.  
  40. if c then
  41. table.insert( C, Color( 30, 160, 40 ) )
  42. table.insert( C, "(TEAM) " )
  43. end
  44.  
  45. if a:IsValid() then
  46. end
  47. for _,v in pairs( CTags ) do
  48. if a:IsUserGroup( v[2] ) then
  49. table.insert( C, cWhite )
  50. table.insert( C, "[" )
  51.  
  52. table.insert( C, v[3] )
  53. table.insert( C, v[1] )
  54.  
  55. table.insert( C, cWhite )
  56. table.insert( C, a:GetName() )
  57. end
  58.  
  59. table.insert( C, team.GetColor( a:Team() ) )
  60. table.insert( C, a:Nick() )
  61. else
  62. table.insert( C, "Console" )
  63. end
  64.  
  65. table.insert( C, Color( 255, 255, 255 ) )
  66. table.insert( C, ": "..b )
  67.  
  68. chat.AddText( unpack( C ) )
  69.  
  70. return true
  71.  
  72. end
  73. hook.Add( "OnPlayerChat", "TTTChatTags", ChatTags )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement