HLMOD.HU Forrás Megtekintés - www.hlmod.hu
  1. /* Formatright © 2013, Jhob94
  2.  
  3. The "Win Messages Changer" is free plugin;
  4. You can redistribute it and/or modify it under the terms of the
  5. GNU General Public License as published by the Free Software Foundation.
  6.  
  7. This plugin is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. GNU General Public License for more details.
  11.  
  12. You should have received a copy of the GNU General Public License
  13. along with "Win Messages Changer" Plugin Source; if not, write to the
  14. Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  15. Boston, MA 02111-1307, USA.
  16.  
  17.  
  18.   ******************************************
  19.   *A scriptet Anonymous1337 magyarosította!*
  20.   ******************************************
  21. */
  22.  
  23. #include <amxmodx>
  24.  
  25. new msgcvar_method
  26. new Text_Msg, WinningTeam
  27. new Trie: tc
  28.  
  29. public plugin_init() {
  30. register_plugin("Win Messages Changer", "0.0.5", "Jhob94")
  31.  
  32. msgcvar_method = register_cvar("msg_method", "0") // 0 = Print_Center | 1 = HUD
  33.  
  34. tc = TrieCreate()
  35. TrieSetCell(tc, "%!MRAD_terwin" , register_cvar("msg_t_win" , "Hibatlan Terrorista gyozelem!"))
  36. TrieSetCell(tc, "%!MRAD_ctwin" , register_cvar("msg_ct_win" , "Hibatlan CT gyozelem!"))
  37. TrieSetCell(tc, "%!MRAD_rounddraw" , register_cvar("msg_rounddraw" , "Nem nyert senki!"))
  38.  
  39. register_message(get_user_msgid("SendAudio"), "Messages_Audio")
  40.  
  41. Text_Msg = get_user_msgid("TextMsg")
  42. }
  43.  
  44. public Messages_Audio(Message_Index, Message_Dest, Index)
  45. {
  46. if(!Index)
  47. {
  48. new Audio[14], won_msg[120]
  49. get_msg_arg_string(2, Audio, charsmax(Audio))
  50.  
  51. if(TrieGetCell(tc, Audio, WinningTeam) && get_pcvar_string(WinningTeam, won_msg, charsmax(won_msg)))
  52. {
  53. if(get_msg_block(Text_Msg) == BLOCK_NOT)
  54. set_msg_block(Text_Msg, BLOCK_ONCE)
  55.  
  56. if(!get_pcvar_num(msgcvar_method))
  57. client_print(0, print_center, "%s", won_msg)
  58.  
  59. else
  60. {
  61. set_hudmessage(0, 250, 0, -1.0, 0.3, 0, 6.0, 12.0, _, _, -1)
  62. show_hudmessage(0, "%s", won_msg)
  63. }
  64.  
  65. return PLUGIN_HANDLED
  66. }
  67. }
  68.  
  69. return PLUGIN_CONTINUE
  70. }