Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- enum _: access_names
- {
- ACCESS_OWNER,
- ACCESS_MANAGER,
- ACCESS_SUPERADMIN,
- ACCESS_ADMIN,
- ACCESS_VIP
- };
- enum _: access_data
- {
- ACCESS_NAME[ 32 ],
- ACCESS_LETTERS[ 32 ],
- ACCESS_FLAG
- };
- new const g_szAccessNames[ access_names ][ access_data ] =
- {
- { "Owner", "abcdefghijklmnopqrstu", ADMIN_RCON },
- { "Manager", "abcdefghijkmnopqrstu", ADMIN_IMMUNITY },
- { "Super Admin","cdefij", ADMIN_BAN },
- { "Admin", "ceij", ADMIN_KICK },
- { "VIP", "eij", ADMIN_SLAY }
- };
- new const szPrefix[ ] = "AMXX";
- #define is_char(%1) (0 < (%1) <= 255)
- #define is_str_empty(%1) (%1[0] == EOS)
- stock bool: is_str_alpha( const string[] )
- {
- new c, i, tmp[ 2 ];
- while ( is_char( c = string[ i++ ] ) )
- {
- if ( isalpha( c ) )
- continue;
- tmp[ 0 ] = c;
- return false;
- }
- return ( i > 1 );
- }
- stock ColorPrint( const index, const string[], any:... )
- {
- new szMsg[ 512 ], Players[ 32 ], PNum = 1;
- static iLen; iLen = formatex( szMsg, charsmax( szMsg ), "^4[%s]^1 ", szPrefix );
- vformat( szMsg[ iLen ], charsmax( szMsg ) - iLen, string, 3 );
- if ( index )
- Players[ 0 ] = index;
- else
- get_players( Players, PNum, "ch" );
- for ( new i; i < PNum; i++ )
- {
- if( is_user_connected( Players[ i ] ) )
- {
- message_begin( MSG_ONE_UNRELIABLE, get_user_msgid( "SayText" ), _, Players[ i ] );
- write_byte( Players[ i ] );
- write_string( szMsg );
- message_end( );
- }
- }
- return 1;
- }
- stock szName( const index )
- {
- static g_szName[ 32 ];
- get_user_name( index, g_szName, charsmax( g_szName ) );
- return g_szName;
- }
- stock szAuth( const index )
- {
- static g_szAuthid[ 32 ];
- get_user_authid( index, g_szAuthid, charsmax( g_szAuthid ) );
- return g_szAuthid;
- }
Advertisement
Add Comment
Please, Sign In to add comment