Rejack

Admins Manager.inc

Jan 10th, 2017 (edited)
167
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 1.74 KB | None | 0 0
  1. enum _: access_names
  2. {
  3.     ACCESS_OWNER,
  4.     ACCESS_MANAGER,
  5.     ACCESS_SUPERADMIN,
  6.     ACCESS_ADMIN,
  7.     ACCESS_VIP
  8. };
  9.  
  10. enum _: access_data
  11. {
  12.     ACCESS_NAME[ 32 ],
  13.     ACCESS_LETTERS[ 32 ],
  14.     ACCESS_FLAG
  15. };
  16.  
  17. new const g_szAccessNames[ access_names ][ access_data ] =
  18. {
  19.     { "Owner",  "abcdefghijklmnopqrstu",    ADMIN_RCON },
  20.     { "Manager",    "abcdefghijkmnopqrstu",     ADMIN_IMMUNITY },
  21.     { "Super Admin","cdefij",           ADMIN_BAN },
  22.     { "Admin",  "ceij",             ADMIN_KICK },
  23.     { "VIP",    "eij",              ADMIN_SLAY }
  24. };
  25.  
  26. new const szPrefix[ ] = "AMXX";
  27.  
  28. #define is_char(%1) (0 < (%1) <= 255)
  29.  
  30. #define is_str_empty(%1) (%1[0] == EOS)
  31. stock bool: is_str_alpha( const string[] )
  32. {
  33.     new c, i, tmp[ 2 ];
  34.    
  35.     while ( is_char( c = string[ i++ ] ) )
  36.     {
  37.         if ( isalpha( c ) )
  38.             continue;
  39.        
  40.         tmp[ 0 ]    = c;
  41.        
  42.         return false;
  43.     }
  44.    
  45.     return ( i > 1 );
  46. }
  47. stock ColorPrint( const index, const string[], any:... )
  48. {
  49.     new szMsg[ 512 ], Players[ 32 ], PNum = 1;
  50.    
  51.     static iLen; iLen = formatex( szMsg, charsmax( szMsg ), "^4[%s]^1 ", szPrefix );
  52.    
  53.     vformat( szMsg[ iLen ], charsmax( szMsg ) - iLen, string, 3 );
  54.    
  55.     if ( index )
  56.         Players[ 0 ] = index;
  57.    
  58.     else
  59.         get_players( Players, PNum, "ch" );
  60.    
  61.     for ( new i; i < PNum; i++ )
  62.     {
  63.         if( is_user_connected( Players[ i ] ) )
  64.         {
  65.             message_begin( MSG_ONE_UNRELIABLE, get_user_msgid( "SayText" ), _, Players[ i ] );
  66.            
  67.             write_byte( Players[ i ] );
  68.            
  69.             write_string( szMsg );
  70.            
  71.             message_end( );
  72.         }
  73.     }
  74.    
  75.     return 1;
  76. }
  77.  
  78. stock szName( const index )
  79. {
  80.     static g_szName[ 32 ];
  81.    
  82.     get_user_name( index, g_szName, charsmax( g_szName ) );
  83.    
  84.     return g_szName;
  85. }
  86.  
  87. stock szAuth( const index )
  88. {
  89.     static g_szAuthid[ 32 ];
  90.    
  91.     get_user_authid( index, g_szAuthid, charsmax( g_szAuthid ) );
  92.    
  93.     return g_szAuthid;
  94. }
Advertisement
Add Comment
Please, Sign In to add comment