Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* Plugin was created by Rejack and was never tested. */
- #include < amxmodx >
- #include < cstrike >
- #include < ColorChat >
- #define ADMIN_LISTEN ADMIN_RCON
- enum _:enAdminsData
- {
- Flag,
- Name[ 32 ]
- };
- new szAdmins[ ][ enAdminsData ] =
- {
- { ADMIN_RCON, "OWNER" },
- { ADMIN_IMMUNITY, "MANAGER" },
- { ADMIN_BAN, "SUPER ADMIN" },
- { ADMIN_KICK, "ADMIN" },
- { ADMIN_SLAY, "VIP" }
- };
- new Cvars[ 3 ];
- public plugin_init()
- {
- register_plugin( "Admins Tags", "1.0", "Rejack" );
- register_clcmd( "say", "CmdSay" );
- register_clcmd( "say_team", "CmdSayTeam" );
- Cvars[ 0 ] = register_cvar( "at_enabled", "1" ); // Enable or Disable the plugin
- Cvars[ 1 ] = register_cvar( "at_admin_listen", "1" ); // Admins can see say teams.( if "at_all_chat" is set to 0 then they will be able to see dead and alive as well )
- Cvars[ 2 ] = register_cvar( "at_all_chat", "1" ); // Alive players can see Dead players messages.
- }
- public CmdSay( client )
- {
- if ( !( get_user_flags( client ) & ADMIN_SLAY ) )
- return 0;
- new szMsg[ 512 ];
- read_args( szMsg, charsmax( szMsg ) );
- remove_quotes( szMsg );
- if ( szMsg[ 0 ] == '!' || szMsg[ 0 ] == '@' || szMsg[ 0 ] == '/' || equali( szMsg, "" ) || equali( szMsg, " " ) || equali( szMsg, " " ) )
- return 0;
- new iAdmin;
- for ( new i; i < sizeof szAdmins; i++ )
- {
- if ( get_user_flags( client ) & szAdmins[ i ][ Flag ] )
- {
- iAdmin = i;
- break;
- }
- }
- PrintMessage( client, false, szAdmins[ iAdmin ][ Name ], GetUserName( client ), szMsg );
- return 1;
- }
- public CmdSayTeam( client )
- {
- if ( !( get_user_flags( client ) & ADMIN_SLAY ) )
- return 0;
- new szMsg[ 512 ];
- read_args( szMsg, charsmax( szMsg ) );
- remove_quotes( szMsg );
- if ( szMsg[ 0 ] == '!' || szMsg[ 0 ] == '@' || szMsg[ 0 ] == '/' || equali( szMsg, "" ) || equali( szMsg, " " ) || equali( szMsg, " " ) )
- return 0;
- new iAdmin;
- for ( new i; i < sizeof szAdmins; i++ )
- {
- if ( get_user_flags( client ) & szAdmins[ i ][ Flag ] )
- {
- iAdmin = i;
- break;
- }
- }
- PrintMessage( client, true, szAdmins[ iAdmin ][ Name ], GetUserName( client ), szMsg );
- return 1;
- }
- /* Stocks */
- stock GetUserName( const index )
- {
- static g_szName[ 32 ];
- get_user_name( index, g_szName, charsmax( g_szName ) );
- return g_szName;
- }
- stock GetTeamColor( const index )
- {
- switch ( cs_get_user_team( index ) )
- {
- case CS_TEAM_CT: return BLUE;
- case CS_TEAM_SPECTATOR: return GREY;
- case CS_TEAM_T: return RED;
- }
- return 1;
- }
- stock GetTeamName( const index )
- {
- new szTeam[ 18 ];
- switch ( cs_get_user_team( index ) )
- {
- case CS_TEAM_CT: szTeam = "Counter-Terrorist";
- case CS_TEAM_SPECTATOR: szTeam = "SPEC";
- case CS_TEAM_T: szTeam = "Terrorist";
- }
- return szTeam;
- }
- stock PrintMessage( const index, bool: bTeam, szTag[], szName[], szMsg[] )
- {
- static g_iMaxPlayers, szTeam[ 22 ];
- g_iMaxPlayers = get_maxplayers();
- if ( bTeam )
- formatex( szTeam, charsmax( szTeam ), " (%s)", GetTeamName( index ) );
- for ( new i = 1; i < g_iMaxPlayers; i++ )
- {
- if ( !is_user_connected( i ) )
- continue;
- if ( bTeam && get_pcvar_num( Cvars[ 1 ] ) == 1 && cs_get_user_team( index ) != cs_get_user_team( i ) && !( get_user_flags( i ) & ADMIN_LISTEN ) )
- continue;
- if ( get_pcvar_num( Cvars[ 2 ] ) == 0 )
- {
- if ( get_pcvar_num( Cvars[ 1 ] ) == 1 && !( get_user_flags( i ) & ADMIN_LISTEN ) )
- {
- if ( is_user_alive( index ) && !is_user_alive( i ) || !is_user_alive( index ) && is_user_alive( i ) )
- continue;
- }
- }
- ColorChat( i, GetTeamColor( index ), "^1%s%s^4[%s]^3 %s :^4 %s", is_user_alive( index ) ? "" : "*DEAD*", bTeam ? szTeam : "", szTag, szName, szMsg );
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment