Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include < amxmodx >
- new Lines, pCvar;
- new Float:g_Lines[ ] = { -0.75, -0.735, -0.72, -0.705, -0.69, -0.675 };
- new const g_Colors[ ][ 3 ] =
- {
- { 255, 150, 0 },
- { 255, 0, 255 },
- { 0, 255, 255 },
- { 0, 160, 0 },
- { 0, 120, 255 }
- };
- public plugin_init( )
- {
- register_plugin( "AMXX Admin Chat", "0.5b", "Rejack" );
- register_clcmd( "say" , "cmdSayChat" );
- pCvar = register_cvar( "ac_color", "1" );
- }
- public cmdSayChat( client )
- {
- new szMsg[ 192 ], szArg[ 24 ];
- read_args( szMsg, charsmax( szMsg ) )
- read_argv( 1, szArg, charsmax( szArg ) );
- remove_quotes( szMsg );
- static szName[ 32 ];get_user_name( client, szName, charsmax( szName ) );
- if ( get_user_flags( client ) & ADMIN_CHAT )
- {
- if ( szArg[ 0 ] == '@' )
- {
- replace( szMsg, charsmax( szMsg ), "@", "" );
- if ( Lines == 5 ) Lines = 0;
- new r = random( 255 );
- new g = random( 255 );
- new b = random( 255 );
- if ( get_user_flags( client ) & ADMIN_IMMUNITY )
- {
- if ( get_pcvar_num( pCvar ) == 0 ) set_hudmessage( g_Colors[ 0 ][ 0 ], g_Colors[ 0 ][ 1 ], g_Colors[ 0 ][ 2 ], -0.75, g_Lines[ Lines ], 1, 6.0, 6.0, 0.5, 0.15, -1 );
- else set_hudmessage( r, g, b, -0.75, g_Lines[ Lines ], 1, 6.0, 6.0, 0.5, 0.15, -1 );
- show_hudmessage( 0, "[ Owner ] %s : %s", szName, szMsg );
- Lines += 1;
- return ColorPrint( 0, "[^3 Owner ^1]^4 %s^1 :^3 %s", szName, szMsg );
- }
- if ( get_user_flags( client ) & ADMIN_RESERVATION )
- {
- if ( get_pcvar_num( pCvar ) == 0 ) set_hudmessage( g_Colors[ 1 ][ 0 ], g_Colors[ 1 ][ 1 ], g_Colors[ 1 ][ 2 ], -0.75, g_Lines[ Lines ], 1, 6.0, 6.0, 0.5, 0.15, -1 );
- else set_hudmessage( r, g, b, -0.75, g_Lines[ Lines ], 1, 6.0, 6.0, 0.5, 0.15, -1 );
- show_hudmessage( 0, "[ Manager ] %s : %s", szName, szMsg );
- Lines += 1;
- return ColorPrint( 0, "[^3 Manager ^1]^4 %s^1 :^3 %s", szName, szMsg );
- }
- if ( get_user_flags( client ) & ADMIN_BAN )
- {
- if ( get_pcvar_num( pCvar ) == 0 ) set_hudmessage( g_Colors[ 2 ][ 0 ], g_Colors[ 2 ][ 1 ], g_Colors[ 2 ][ 2 ], -0.75, g_Lines[ Lines ], 1, 6.0, 6.0, 0.5, 0.15, -1 );
- else set_hudmessage( r, g, b, -0.75, g_Lines[ Lines ], 1, 6.0, 6.0, 0.5, 0.15, -1 );
- show_hudmessage( 0, "[ Super-Admin ] %s : %s", szName, szMsg );
- Lines += 1;
- return ColorPrint( 0, "[^3 Super-Admin ^1]^4 %s^1 :^3 %s", szName, szMsg );
- }
- if ( get_user_flags( client ) & ADMIN_KICK )
- {
- if ( get_pcvar_num( pCvar ) == 0 ) set_hudmessage( g_Colors[ 3 ][ 0 ], g_Colors[ 3 ][ 1 ], g_Colors[ 3 ][ 2 ], -0.75, g_Lines[ Lines ], 1, 6.0, 6.0, 0.5, 0.15, -1 );
- else set_hudmessage( r, g, b, -0.75, g_Lines[ Lines ], 1, 6.0, 6.0, 0.5, 0.15, -1 );
- show_hudmessage( 0, "[ Admin ] %s : %s", szName, szMsg );
- Lines += 1;
- return ColorPrint( 0, "[^3 Admin ^1]^4 %s^1 :^3 %s", szName, szMsg );
- }
- if ( get_user_flags( client ) & ADMIN_SLAY )
- {
- if ( get_pcvar_num( pCvar ) == 0 ) set_hudmessage( g_Colors[ 4 ][ 0 ], g_Colors[ 4 ][ 1 ], g_Colors[ 4 ][ 2 ], -0.75, g_Lines[ Lines ], 1, 6.0, 6.0, 0.5, 0.15, -1 );
- else set_hudmessage( r, g, b, -0.75, g_Lines[ Lines ], 1, 6.0, 6.0, 0.5, 0.15, -1 );
- show_hudmessage( 0, "[ VIP ] %s : %s", szName, szMsg );
- Lines += 1;
- return ColorPrint( 0, "[^3 VIP ^1]^4 %s^1 :^3 %s", szName, szMsg );
- }
- }
- }
- return PLUGIN_CONTINUE;
- }
- stock ColorPrint( const client, const string[], any:... )
- {
- new msg[ 191 ], players[ 32 ], count = 1;
- static len; len = formatex( msg, charsmax( msg ), "^1" );
- vformat( msg[ len ], charsmax( msg ) - len, string, 3 );
- if( client ) players[ 0 ] = client;
- else get_players( players,count,"ch" );
- for ( new i = 0; i < count; i++ )
- {
- if( is_user_connected( players[ i ] ) )
- {
- message_begin( MSG_ONE_UNRELIABLE, get_user_msgid( "SayText" ), _, players[ i ] );
- write_byte( players[ i ] );
- write_string( msg );
- message_end( );
- }
- }
- return PLUGIN_HANDLED;
- }
Advertisement
Add Comment
Please, Sign In to add comment