Advertisement
ColdWar-Pawn

Admins Check - With Super Admin

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