Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include < amxmodx >
- new Float:xPos[ 3 ] = { 0.05, -1.0, -1.0 };
- new Float:yPos[ 3 ] = { 0.55, 0.2, 0.7 };
- new g_iLine[ 3 ];
- new g_iAccess[ ] = { ADMIN_RCON, ADMIN_IMMUNITY, ADMIN_BAN, ADMIN_KICK, ADMIN_SLAY };
- new szAccess[ ][ ] = { "Owner", "Manager", "Super Admin", "Admin", "VIP" };
- new g_Colors[ ][ ] = { { 255, 255, 255 },{ 255, 0, 0 },{ 0, 255, 0 },{ 0, 0, 255 },{ 255, 255, 0 },{ 255, 0, 255 },{ 0, 255, 255 },{ 277, 96, 8 },{ 45, 89, 116 },{ 103, 44, 38 } };
- new szColors[ ][ ] = { "", "r", "g", "b", "y", "m", "c", "o" };
- public plugin_init()
- {
- register_plugin( "Admins Chat", "1.0", "Rejack" );
- register_clcmd( "say", "CmdSay" );
- }
- public CmdSay( client )
- {
- if ( !( get_user_flags( client ) & ADMIN_CHAT ) )
- return 0;
- new szSigns[ 6 ], i = 0;
- read_argv( 1, szSigns, charsmax( szSigns ) );
- while ( szSigns[ i ] == '@' )
- i++;
- if ( !i || i > 3 )
- return 0;
- new c = 0;
- switch( szSigns[ i ] )
- {
- case 'r': c = 1
- case 'g': c = 2
- case 'b': c = 3
- case 'y': c = 4
- case 'm': c = 5
- case 'c': c = 6
- case 'o': c = 7
- }
- new szMsg[ 192 ];
- read_args( szMsg, charsmax( szMsg ) );
- remove_quotes( szMsg );
- for ( new j; j < i; j++ )
- replace( szMsg, charsmax( szMsg ), "@", "" );
- if ( c )
- replace( szMsg, charsmax( szMsg ), szColors[ c ], "" );
- set_hudmessage( g_Colors[ c ][ 0 ], g_Colors[ c ][ 1 ], g_Colors[ c ][ 2 ], xPos[ i - 1 ], yPos[ i - 1 ], 0, 0.0, 8.0, 0.1, 0.1, -1 );
- g_iLine[ i - 1 ]++;
- new szLines[ 32 ];
- for ( new o = 0; o < g_iLine[ i - 1 ]; o++ )
- add( szLines, charsmax( szLines ), "^n" );
- show_hudmessage( 0, "%s(%s) %s: %s", szLines, GetUserTag( client ), GetUserName( client ), szMsg );
- if ( g_iLine[ i - 1 ] == 4 )
- g_iLine[ i - 1 ] = 0;
- return 1;
- }
- stock GetUserName( const index )
- {
- static Name[ 128 ];
- get_user_name( index, Name, charsmax( Name ) );
- return Name;
- }
- stock GetUserTag( const index )
- {
- new g_szAccess[ 12 ];
- for ( new i; i < sizeof szAccess; i++ )
- {
- if ( get_user_flags( index ) & g_iAccess[ i ] )
- {
- formatex( g_szAccess, charsmax( g_szAccess ), "%s", szAccess[ i ] );
- break;
- }
- }
- return g_szAccess;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement