hlmod.hu
https://hlmod.hu/

Fire in the hole
https://hlmod.hu/viewtopic.php?f=9&t=24758
Oldal: 1 / 1

Szerző:  *GrafitY* [ 2016.04.29. 22:28 ]
Hozzászólás témája:  Fire in the hole

Sziasztok!
Van egy plugin, amivel letíltottam a "Fire in the hole" üzeneteket, viszont a hangot sem játsza le.
Valaki tudna segíteni, hogy a hangot lejátsza, de viszont ne legyen "Fire in the hole" üzenet???

Köszönöm előre!

  1. #include <amxmodx>
  2.  
  3. enum _:CvarBits (<<=1) {
  4.     BLOCK_RADIO = 1,
  5.     BLOCK_MSG
  6. };
  7.  
  8. new g_pCvar;
  9.  
  10. public plugin_init( ) {
  11.     register_plugin( "'Fire in the hole' blocker", "1.0", "xPaw" );
  12.    
  13.     g_pCvar = register_cvar( "sv_fith_block", "3" );
  14.    
  15.     register_message( get_user_msgid( "TextMsg" ),   "MessageTextMsg" );
  16.     register_message( get_user_msgid( "SendAudio" ), "MessageSendAudio" );
  17. }
  18.  
  19. public MessageTextMsg( )
  20.     return ( get_msg_args( ) == 5 && IsBlocked( BLOCK_MSG ) ) ? GetReturnValue( 5, "#Fire_in_the_hole" ) : PLUGIN_CONTINUE;
  21.  
  22. public MessageSendAudio( )
  23.     return IsBlocked( BLOCK_RADIO ) ? GetReturnValue( 2, "%!MRAD_FIREINHOLE" ) : PLUGIN_CONTINUE;
  24.  
  25. GetReturnValue( const iParam, const szString[ ] ) {
  26.     new szTemp[ 18 ];
  27.     get_msg_arg_string( iParam, szTemp, 17 );
  28.    
  29.     return ( equal( szTemp, szString ) ) ? PLUGIN_HANDLED : PLUGIN_CONTINUE;
  30. }
  31.  
  32. bool:IsBlocked( const iType )
  33.     return bool:( get_pcvar_num( g_pCvar ) & iType );

Szerző:  SmaCk [ 2016.04.29. 22:46 ]
Hozzászólás témája:  Re: Fire in the hole

Try:

  1. #include <amxmodx>
  2.  
  3. enum _:CvarBits (<<=1) {
  4.     BLOCK_MSG
  5. };
  6.  
  7. new g_pCvar;
  8.  
  9. public plugin_init( ) {
  10.     register_plugin( "'Fire in the hole' blocker", "1.0", "xPaw" );
  11.    
  12.     g_pCvar = register_cvar( "sv_fith_block", "3" );
  13.    
  14.     register_message( get_user_msgid( "TextMsg" ),   "MessageTextMsg" );
  15. }
  16.  
  17. public MessageTextMsg( )
  18.     return ( get_msg_args( ) == 5 && IsBlocked( BLOCK_MSG ) ) ? GetReturnValue( 5, "#Fire_in_the_hole" ) : PLUGIN_CONTINUE;
  19.  
  20.  
  21. GetReturnValue( const iParam, const szString[ ] ) {
  22.     new szTemp[ 18 ];
  23.     get_msg_arg_string( iParam, szTemp, 17 );
  24.    
  25.     return ( equal( szTemp, szString ) ) ? PLUGIN_HANDLED : PLUGIN_CONTINUE;
  26. }
  27.  
  28. bool:IsBlocked( const iType )
  29.     return bool:( get_pcvar_num( g_pCvar ) & iType );

Szerző:  *GrafitY* [ 2016.04.29. 23:24 ]
Hozzászólás témája:  Re: Fire in the hole

SmaCk írta:
Try:

  1. #include <amxmodx>
  2.  
  3. enum _:CvarBits (<<=1) {
  4.     BLOCK_MSG
  5. };
  6.  
  7. new g_pCvar;
  8.  
  9. public plugin_init( ) {
  10.     register_plugin( "'Fire in the hole' blocker", "1.0", "xPaw" );
  11.    
  12.     g_pCvar = register_cvar( "sv_fith_block", "3" );
  13.    
  14.     register_message( get_user_msgid( "TextMsg" ),   "MessageTextMsg" );
  15. }
  16.  
  17. public MessageTextMsg( )
  18.     return ( get_msg_args( ) == 5 && IsBlocked( BLOCK_MSG ) ) ? GetReturnValue( 5, "#Fire_in_the_hole" ) : PLUGIN_CONTINUE;
  19.  
  20.  
  21. GetReturnValue( const iParam, const szString[ ] ) {
  22.     new szTemp[ 18 ];
  23.     get_msg_arg_string( iParam, szTemp, 17 );
  24.    
  25.     return ( equal( szTemp, szString ) ) ? PLUGIN_HANDLED : PLUGIN_CONTINUE;
  26. }
  27.  
  28. bool:IsBlocked( const iType )
  29.     return bool:( get_pcvar_num( g_pCvar ) & iType );


Így ki írja, és hangot nem játszik le.

Szerző:  Akosch:. [ 2016.04.29. 23:28 ]
Hozzászólás témája:  Re: Fire in the hole

sv_fith_block "2"

Szerző:  *GrafitY* [ 2016.04.29. 23:39 ]
Hozzászólás témája:  Re: Fire in the hole

Akosch:. írta:
sv_fith_block "2"


Nem írja ki, de hang sincs :?

Szerző:  mforce [ 2016.04.30. 20:39 ]
Hozzászólás témája:  Re: Fire in the hole

  1. #include <amxmodx>
  2.  
  3. new const g_sFireInTheHole[] = "#Fire_in_the_hole";
  4. new text[sizeof(g_sFireInTheHole)];
  5.  
  6. public plugin_init()
  7. {
  8.    register_plugin("Block Grenade Info", "1.0", "neugomon");
  9.    register_message(get_user_msgid("TextMsg"),"msgTextMsg");
  10. }
  11.  
  12. public msgTextMsg()
  13. {
  14.    if(get_msg_args() == 5 && get_msg_argtype(5) == ARG_STRING)
  15.    {
  16.       get_msg_arg_string(5, text, sizeof text - 1);
  17.       if(equali(text, g_sFireInTheHole)) return PLUGIN_HANDLED
  18.    }
  19.    return PLUGIN_CONTINUE
  20. }

Szerző:  csongika [ 2016.04.30. 20:53 ]
Hozzászólás témája:  Re: Fire in the hole

  1. #include <amxmodx>
  2.  
  3. #define PLUGIN "Block 'Fire in the hole!'"
  4. #define VERSION "0.1"
  5. #define AUTHOR "Safety1st"
  6.  
  7. public plugin_init() {
  8.     register_plugin( PLUGIN, VERSION, AUTHOR )
  9.  
  10.     register_message( get_user_msgid( "TextMsg" ), "TextMsgHandler" )
  11. }
  12.  
  13. public TextMsgHandler( msgid, dest, receiver ) {
  14.     #define ARG_DESTINATION_TYPE  1
  15.     #define print_radio           5
  16.     #define ARG_RADIO_STRING      5
  17.  
  18.     static const szFireInTheHole[] = "#Fire_in_the_hole"
  19.     static szMsg[18]
  20.  
  21.     if( get_msg_arg_int(ARG_DESTINATION_TYPE) != print_radio )
  22.         return PLUGIN_CONTINUE
  23.  
  24.     get_msg_arg_string( ARG_RADIO_STRING, szMsg, charsmax(szMsg) )
  25.     if( !strcmp( szMsg, szFireInTheHole ) )
  26.         return PLUGIN_HANDLED
  27.  
  28.     return PLUGIN_CONTINUE
  29. }
  30.  
  31. /**
  32. *   Some typical radio messages:
  33. *
  34. *   MessageBegin (TextMsg "77") (Destination "One<1>") (Args "5") (Entity "1")
  35. *   Arg 1 (Byte "5")
  36. *   Arg 2 (String "1")
  37. *   Arg 3 (String "#Game_radio")
  38. *   Arg 4 (String "Player Nick")
  39. *   Arg 5 (String "#Fire_in_the_hole")
  40. *   MessageEnd (TextMsg "77")
  41. *
  42. *   MessageBegin (TextMsg "77") (Destination "One<1>") (Args "5") (Entity "1")
  43. *   Arg 1 (Byte "5")
  44. *   Arg 2 (String "1")
  45. *   Arg 3 (String "#Game_radio")
  46. *   Arg 4 (String "Player Nick")
  47. *   Arg 5 (String "#Go_go_go")
  48. *   MessageEnd (TextMsg "77")
  49. */

Oldal: 1 / 1 Minden időpont UTC+02:00 időzóna szerinti
Powered by phpBB® Forum Software © phpBB Limited
https://www.phpbb.com/