Advertisement
Guest User

Untitled

a guest
Apr 25th, 2014
36
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.80 KB | None | 0 0
  1. local userGroups =
  2. {
  3. vip = true,
  4. moderator = true,
  5. superadmin = true,
  6. admin = true,
  7. user = true,
  8. headadmin = true,
  9. owner = true,
  10. respected = true,
  11. coder = true
  12. }
  13.  
  14. hook.Add("OnPlayerChat", "prefixes", function(ply, text, teamOnly, alive, prefixText, color1, color2)
  15. if not userGroups[string.lower(ply:GetNWString("usergroup"))] then
  16. chat.AddText(Color(255, 0, 0, 255), "[" .. ply:GetNWString("usergroup") .. "] ", color1, prefixText, color2, ": "..text)
  17. return true
  18.  
  19. elseif ply:IsValid() and ply:IsPlayer() and ply:IsUserGroup("moderator") then
  20. rank_str = "Mod"
  21. rank_col = Color( 0, 255, 255 )
  22. bracket_col = Color( 0, 255, 255 )
  23. chat.AddText(bracket_col, bracket_col and " [" or "", rank_col, rank_str, bracket_col, bracket_col and "] " or "", color1, prefixText, color2, ": "..text)
  24. return true
  25.  
  26. elseif ply:IsValid() and ply:IsPlayer() and ply:IsUserGroup("superadmin") then
  27. rank_str = "SuperAdmin"
  28. rank_col = Color( 255, 51, 0 )
  29. bracket_col = Color( 255, 51, 0 )
  30. chat.AddText(bracket_col, bracket_col and " [" or "", rank_col, rank_str, bracket_col, bracket_col and "] " or "", color1, prefixText, color2, ": "..text)
  31. return true
  32.  
  33. elseif ply:IsValid() and ply:IsPlayer() and ply:IsUserGroup("owner") then
  34. rank_str = "Owner"
  35. rank_col = Color( 153, 0, 153 )
  36. bracket_col = Color( 153, 0, 153 )
  37. chat.AddText(bracket_col, bracket_col and " [" or "", rank_col, rank_str, bracket_col, bracket_col and "] " or "", color1, prefixText, color2, ": "..text)
  38. return true
  39.  
  40. elseif ply:IsValid() and ply:IsPlayer() and ply:IsUserGroup("admin") then
  41. rank_str = "Admin"
  42. rank_col = Color( 51, 255, 0 )
  43. bracket_col = Color( 51, 255, 0 )
  44. chat.AddText(bracket_col, bracket_col and " [" or "", rank_col, rank_str, bracket_col, bracket_col and "] " or "", color1, prefixText, color2, ": "..text)
  45. return true
  46.  
  47. elseif ply:IsValid() and ply:IsPlayer() and ply:IsUserGroup("vip") then
  48. rank_str = "VIP"
  49. rank_col = Color( 100, 255, 204 )
  50. bracket_col = Color( 100, 255, 204 )
  51. chat.AddText(bracket_col, bracket_col and " [" or "", rank_col, rank_str, bracket_col, bracket_col and "] " or "", color1, prefixText, color2, ": "..text)
  52. return true
  53.  
  54. elseif ply:IsValid() and ply:IsPlayer() and ply:IsUserGroup("respected") then
  55. rank_str = "Respected"
  56. rank_col = Color( 100, 0, 255 )
  57. bracket_col = Color( 100, 0, 255 )
  58. chat.AddText(bracket_col, bracket_col and " [" or "", rank_col, rank_str, bracket_col, bracket_col and "] " or "", color1, prefixText, color2, ": "..text)
  59. return true
  60.  
  61. elseif ply:IsValid() and ply:IsPlayer() and ply:IsUserGroup("coder") then
  62. rank_str = "Coder"
  63. rank_col = Color( 0, 153, 102 )
  64. bracket_col = Color( 0, 153, 102 )
  65. chat.AddText(bracket_col, bracket_col and " [" or "", rank_col, rank_str, bracket_col, bracket_col and "] " or "", color1, prefixText, color2, ": "..text)
  66. return true
  67.  
  68. elseif ply:IsValid() and ply:IsPlayer() and ply:IsUserGroup("headadmin") then
  69. rank_str = "HeadAdmin"
  70. rank_col = Color( 0, 0, 255 )
  71. bracket_col = Color( 0, 0, 255 )
  72. chat.AddText(bracket_col, bracket_col and " [" or "", rank_col, rank_str, bracket_col, bracket_col and "] " or "", color1, prefixText, color2, ": "..text)
  73. return true
  74.  
  75. else
  76. rank_str = "User"
  77. rank_col = Color( 0, 255, 0 )
  78. bracket_col = Color( 0, 255, 0 )
  79. chat.AddText(bracket_col, bracket_col and " [" or "", rank_col, rank_str, bracket_col, bracket_col and "] " or "", color1, prefixText, color2, ": "..text)
  80. return true
  81. end
  82. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement