Advertisement
ColdWar-Pawn

Team Win

May 4th, 2013
671
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 1.28 KB | None | 0 0
  1. /* Plugin generated by AMXX-Studio */
  2.  
  3. #include <amxmodx>
  4.  
  5. new g_iMaxPlayers;
  6.  
  7. public plugin_init()
  8. {
  9.     register_plugin( "Team Win", "v1.0", "+ColdWar" )
  10.    
  11.     register_event( "SendAudio", "CmdTWins", "a", "2&%!MRAD_terwin" );
  12.     register_event( "SendAudio", "CmdCTWins", "a", "2&%!MRAD_ctwin" );
  13.    
  14.     g_iMaxPlayers = get_maxplayers( );
  15. }
  16.  
  17. public CmdTWins( )
  18.     ColorChat( 0, "Terrorists ^4Win^1." );
  19.  
  20. public CmdCTWins( )
  21.     ColorChat( 0, "Counter^3-^1Terrorists ^4Win^1." );
  22.  
  23. stock ColorChat( index, message[], any:... )
  24. {
  25.     if( index && !is_user_connected( index ) )
  26.         return 0;
  27.    
  28.     static szMessage[ 242 ], len;
  29.    
  30.     len = formatex( szMessage, charsmax( szMessage ), "^4[AMXX]^1 " );
  31.     len += vformat( szMessage[ len ], charsmax( szMessage ) - len, message, 3 );
  32.    
  33.     static st_msgid;
  34.     if( !st_msgid )
  35.         st_msgid = get_user_msgid( "SayText" );
  36.    
  37.     if( index )
  38.     {
  39.         message_begin( MSG_ONE_UNRELIABLE, st_msgid, _, index );
  40.         write_byte( index );
  41.         write_string( szMessage );
  42.         message_end( );
  43.     }
  44.     else
  45.     {
  46.         for( index = 1 ; index <= g_iMaxPlayers ; index ++ )
  47.         {
  48.             if( !is_user_connected( index ) )
  49.                 continue;
  50.            
  51.             message_begin( MSG_ONE_UNRELIABLE, st_msgid, _, index );
  52.             write_byte( index );
  53.             write_string( szMessage );
  54.             message_end( );
  55.         }
  56.     }
  57.     return 1;
  58. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement