Guest User

Helpers

a guest
Sep 9th, 2014
218
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.89 KB | None | 0 0
  1. #include <amxmodx>
  2. #include <amxmisc>
  3.  
  4. #define PLUGIN "Who"
  5. #define VERSION "1.0"
  6. #define AUTHOR "Codrin Bradea SATANA:"
  7.  
  8. #define CharsMax(%1) sizeof %1 - 1
  9.  
  10. #define MAX_GROUPS 4
  11.  
  12. new g_groupNames[MAX_GROUPS][] = {
  13.  
  14. "Helper Level[1]",
  15. "Helper Level[2]",
  16. "Helper Level[3]",
  17. "Helper Level[4]"
  18.  
  19. }
  20.  
  21. new g_groupFlags[MAX_GROUPS][] = {
  22.  
  23.  
  24. "cefj",
  25. "bcef",
  26. "bcdefgh",
  27. "bcdefghij"
  28.  
  29. }
  30.  
  31. new g_groupFlagsValue[MAX_GROUPS];
  32.  
  33. public plugin_init() {
  34.  
  35. register_plugin(PLUGIN, VERSION, AUTHOR);
  36.  
  37. for(new i = 0; i < MAX_GROUPS; i++)
  38. g_groupFlagsValue[i] = read_flags(g_groupFlags[i]);
  39.  
  40. register_clcmd("admin_who", "cmdWho", -1, "");
  41. register_clcmd("say /helpers", "cmdWho", -1, "");
  42. register_clcmd("say /helpers", "cmdWho", -1, "");
  43. register_clcmd("say /helpers", "cmdWho", -1, "");
  44. register_clcmd("say staff", "cmdWho", -1, "");
  45. register_clcmd("say staff", "cmdWho", -1, "");
  46. register_clcmd("say /staff", "cmdWho", -1, "");
  47. register_clcmd("say helpers", "cmdWho", -1, "");
  48. }
  49.  
  50.  
  51. public cmdWho(id)
  52. {
  53. static sPlayers[32], iNum, iPlayer;
  54. static sName[32], sBuffer[1024];
  55.  
  56. static iLen;
  57. iLen = formatex(sBuffer, sizeof sBuffer - 1, "<body bgcolor=#000000><font color=#7b68ee><pre>");
  58. iLen += formatex(sBuffer[iLen], CharsMax(sBuffer) - iLen,"<center><h2><font color=^"yellow^"><B>[=Helperi Online=]</B></font></h2></center>^n^n");
  59.  
  60. get_players(sPlayers, iNum, "ch");
  61.  
  62. for(new i = 0; i < MAX_GROUPS; i++)
  63. {
  64. iLen += formatex(sBuffer[iLen], CharsMax(sBuffer) - iLen, "<center><h5><font color=^"green^">..::<B>%s</B>::..^n</font></h5></center>", g_groupNames[i]);
  65.  
  66. for(new x = 0; x < iNum; x++)
  67. {
  68. iPlayer = sPlayers[x];
  69.  
  70. if(get_user_flags(iPlayer) == g_groupFlagsValue[i])
  71. {
  72. get_user_name(iPlayer, sName, sizeof sName - 1);
  73. iLen += formatex(sBuffer[iLen], CharsMax(sBuffer) - iLen, "<center>%s^n</center>", sName);
  74. }
  75. }
  76. }
  77. show_motd(id, sBuffer, " # Helperi # Online #");
  78. return 0;
  79. }
Advertisement
Add Comment
Please, Sign In to add comment