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