iFenomenal

Ultimate who color

Jan 26th, 2020
308
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.51 KB | None | 0 0
  1. #include <amxmodx>
  2. #include <amxmisc>
  3.  
  4. #define PLUGIN "ULTIMATE WHO"
  5. #define VERSION "1.1"
  6. #define AUTHOR "P.Of.Pw"
  7.  
  8. #define CharsMax(%1) sizeof %1 - 1
  9. #define time_shower 1.0
  10.  
  11. #define GROUPS_NAME 4
  12. #define GROUPS_ACCESS 4
  13.  
  14. #define motd_msg "Admin's Online"
  15.  
  16. new color[][] =
  17. {
  18. "00FF00",
  19. "FF0000",
  20. "0000FF",
  21. "545454"
  22. }
  23.  
  24. new GroupNames[GROUPS_NAME][] =
  25. {
  26. "---=== OwNeR ===---",
  27. "---=== Co-OwNeR ===---",
  28. "---=== AdMiNisTraToR ===---",
  29. "---=== SuPeR MoDeRaToR ===---"
  30. "---=== MoDeRaToR ===---"
  31. "---=== HeLpEr ===---"
  32. "---=== V.I.P ===---"
  33. }
  34.  
  35. new GroupFlags[GROUPS_ACCESS][] =
  36. {
  37. "abcdefghijklmnopqrstu",
  38. "bcdefghijklmnopqrstu",
  39. "bcdefghijmnopqrstu",
  40. "bcdefghijmnop"
  41. "bcefghij"
  42. "bceij"
  43. "b"
  44. }
  45.  
  46. new GroupFlagsValue[GROUPS_NAME]
  47.  
  48. public plugin_init()
  49. {
  50. register_plugin(PLUGIN, VERSION, AUTHOR)
  51.  
  52. for(new p_of_pw = 0 ; p_of_pw < GROUPS_NAME ; p_of_pw++)
  53. GroupFlagsValue[p_of_pw] = read_flags(GroupFlags[p_of_pw])
  54.  
  55. register_clcmd("say", "cmdSay")
  56. register_clcmd("say_team", "cmdSay")
  57. }
  58.  
  59. public cmdSay(id)
  60. {
  61. new say[8]
  62. read_args(say, 7)
  63.  
  64. if ((containi(say, "who") != -1
  65. || containi(say, "admin") != -1
  66. || containi(say, "admins") != -1
  67. || contain(say, "/who") != -1
  68. || contain(say, "/admin") != -1
  69. || contain(say, "/admins") != -1))
  70. who_motd(id)
  71.  
  72. return PLUGIN_CONTINUE
  73. }
  74.  
  75. who_motd(id)
  76. {
  77. new sPlayers[32], iNum, iPlayer
  78. new sName[32], sBuffer[1024]
  79. new iLen
  80.  
  81. iLen = formatex(sBuffer, sizeof sBuffer - 1, "<body bgcolor=#000000><font color=#7b68ee><pre>")
  82.  
  83. get_players(sPlayers, iNum, "ch")
  84.  
  85. for(new p_of_pw = 0; p_of_pw < GROUPS_NAME ; p_of_pw++)
  86. {
  87. iLen += formatex(sBuffer[iLen], CharsMax(sBuffer) - iLen, "<center><h5><font color=^"violet^">%s^n</font></h5></center>", GroupNames[p_of_pw])
  88.  
  89. for(new a = 0; a < iNum ; a++)
  90. {
  91. iPlayer = sPlayers[a]
  92.  
  93. if(get_user_flags(iPlayer) == GroupFlagsValue[p_of_pw])
  94. {
  95. get_user_name(iPlayer, sName, sizeof sName - 1)
  96. iLen += formatex(sBuffer[iLen], CharsMax(sBuffer) - iLen, "<center><font color=^"%s^">%s^n</center></font>", color[p_of_pw], sName)
  97. }
  98. }
  99. }
  100.  
  101. show_motd(id, sBuffer, motd_msg)
  102. return PLUGIN_CONTINUE
  103. }
Add Comment
Please, Sign In to add comment