Advertisement
Guest User

Untitled

a guest
Dec 10th, 2016
142
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.58 KB | None | 0 0
  1. /* Plugin generated by AMXX-Studio */
  2.  
  3. #include <amxmodx>
  4.  
  5.  
  6. enum _:Admins
  7. {
  8. Owner,
  9. Manager,
  10. SuperAdmin,
  11. Admin,
  12. VIP,
  13. Premium
  14. }
  15.  
  16. enum _:AdminLevel
  17. {
  18. Name[12],
  19. Flag
  20. }
  21.  
  22. new const szAdmins[ Admins ][ AdminLevel ] = {
  23. { "Owner", ADMIN_IMMUNITY },
  24. { "Manager", ADMIN_RESERVATION },
  25. { "Super Admin", ADMIN_LEVEL_C },
  26. { "Admin", ADMIN_BAN },
  27. { "VIP", ADMIN_KICK },
  28. { "Premium", ADMIN_SLAY }
  29. }
  30.  
  31. public plugin_init() {
  32. register_plugin( "Admins Check", "v0.0.1", "+ColdWar" )
  33.  
  34. register_saycmd( "admin", "CmdAdmins" );
  35. register_saycmd( "admins", "CmdAdmins" );
  36. }
  37.  
  38. public CmdAdmins( client )
  39. {
  40. new bool: g_bAdded[33], szString[ 200 ], g_iCounter, szName[ 32 ];
  41. for ( new i = 0 ; i < Admins ; i ++ )
  42. {
  43. g_iCounter = 0
  44. szString = ""
  45. for( new j = 1; j <= get_maxplayers () ; j ++ )
  46. {
  47. if( ! is_user_connected( j ) )
  48. continue ;
  49. if( get_user_flags( j ) & szAdmins[ i ][ Flag ] )
  50. {
  51. if( g_bAdded[ j ] )
  52. continue;
  53. g_bAdded[ j ] = true
  54. if( g_iCounter )
  55. add( szString, charsmax( szString ), "^1,^3 " )
  56. g_iCounter ++
  57. get_user_name( j, szName, sizeof szName - 1 );
  58. add( szString, charsmax( szString ), szName );
  59. }
  60.  
  61. }
  62.  
  63. add( szString, charsmax( szString ), "^1." )
  64. if( !g_iCounter )
  65. ColorChat( client, "^1No ^3%ss^1 Online.", szAdmins[ i ][ Name ] )
  66. else
  67. ColorChat( client, "^1%ss Online^1:^3 %s", szAdmins[ i ][ Name ], szString )
  68. }
  69. }
  70.  
  71. stock register_saycmd( const cmd[], const function[], flags = -1, const info[] = "", FlagManager = -1 )
  72. {
  73. new i, j;
  74. new szString[ 64 ];
  75. new const szSayTypes[ ][ ] = { "say", "say_team" };
  76. new const szTypes[ ][ ] = { "", "/", "!", "." };
  77. for( i = 0 ; i < sizeof szSayTypes ; i ++ )
  78. {
  79. for( j = 0 ; j < sizeof szTypes ; j ++ )
  80. {
  81. formatex( szString, sizeof szString - 1, "%s %s%s", szSayTypes[ i ], szTypes[ j ], cmd );
  82. register_clcmd( szString, function, flags, info, FlagManager );
  83. }
  84. }
  85. }
  86.  
  87. stock ColorChat(index, const Msg[], any:... ) {
  88. new Buffer[190], Buffer2[192]
  89. formatex(Buffer2, sizeof(Buffer2)-1, "^4[AMXX]^1 %s", Msg)
  90. vformat(Buffer, sizeof(Buffer)-1, Buffer2, 3)
  91. if(!index)
  92. {
  93. for (new i = 1; i <= get_maxplayers(); i++)
  94. {
  95. if(!is_user_connected(i))
  96. continue
  97. message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"),_, i)
  98. write_byte(i)
  99. write_string(Buffer)
  100. message_end()
  101. }
  102. }
  103. else
  104. {
  105. if(!is_user_connected(index))
  106. return
  107. message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"),_, index)
  108. write_byte(index)
  109. write_string(Buffer)
  110. message_end()
  111. }
  112. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement