Advertisement
Guest User

Untitled

a guest
May 26th, 2015
225
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 3.10 KB | None | 0 0
  1. #include <sourcemod>
  2. #include <cstrike>
  3. #include <sdktools>
  4. #include <clientprefs>
  5. #include <adminmenu>
  6. #include <basecomm>
  7. #include "include/sourcecomms.inc"
  8.  
  9. #define Spectators                              1
  10. #define Terrorists                              2
  11. #define CounterTerrorists               3
  12.  
  13. #pragma semicolon 1
  14.  
  15. public Plugin:myinfo =
  16. {
  17.     name = "TMUTE",
  18.     author = "Selector",
  19.     version = "1.0"
  20. }
  21.  
  22. public OnPluginStart()
  23. {
  24.     RegAdminCmd( "sm_tmute", Jail_Tmute, ADMFLAG_VOTE, "mute the terrorists" );
  25.     RegAdminCmd( "sm_tunmute", Jail_Tunmute, ADMFLAG_VOTE, "mute the terrorists" );
  26. }
  27.  
  28. public Action:Jail_Tmute(client, args)
  29. {
  30.      if ( args > 1 )
  31.         {
  32.                         ReplyToCommand( client, "\x03[Jail] \x04Usage: !tmute" );
  33.                         return Plugin_Handled;
  34.         }
  35.         PrintToChatAll( "[SM] The terrorists are muted." );
  36.         for ( new iClient = 1; iClient <= MaxClients; iClient++ )
  37.         {
  38.                 if ( IsClientInGame( iClient ) )
  39.                 {
  40.                                         if ( GetUserAdmin( iClient ) != INVALID_ADMIN_ID )
  41.                                         {
  42.                                         return Plugin_Continue;
  43.                                         }
  44.                                 if ( GetClientListeningFlags( iClient ) != VOICE_MUTED )
  45.                                 {
  46.                                        
  47.                                                 if ( GetClientTeam( iClient ) == Terrorists )
  48.                                                 {
  49.                                                         SetClientListeningFlags( iClient, VOICE_MUTED );
  50.                                                 }
  51.                                 }
  52.                 }
  53.         }
  54.     return Plugin_Continue;
  55. }
  56. public Action:Jail_Tunmute(client, args)
  57. {
  58.          if ( args > 1 )
  59.         {
  60.                         ReplyToCommand( client, "\x03[Jail] \x04Usage: !tunmute" );
  61.                         return Plugin_Handled;
  62.         }
  63.         PrintToChatAll( "[SM] The terrorists are no longer muted." );
  64.         for ( new iClient = 1; iClient <= MaxClients; iClient++ )
  65.         {
  66.                 if ( IsClientInGame( iClient ) )
  67.                 {
  68.                                 if ( GetUserAdmin( iClient ) != INVALID_ADMIN_ID )
  69.                                 {
  70.                                 return Plugin_Continue;
  71.                                 }
  72.                                 if ( GetClientListeningFlags( iClient ) == VOICE_MUTED )
  73.                                 {
  74.                                        
  75.                                                 if ( GetClientTeam( iClient ) == Terrorists )
  76.                                                 {
  77.                                                      if ( IsPlayerAlive( iClient ) )
  78.                                                      {
  79.                                                         if(bType:SourceComms_GetClientMuteType(iClient) == bNot)
  80.                                                         {
  81.                                                         SetClientListeningFlags( iClient, VOICE_NORMAL );
  82.                                                         }
  83.                                                      }
  84.                                                 }
  85.                                 }
  86.                 }
  87.         }
  88.         return Plugin_Continue;
  89. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement