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. #include <amxmodx>
  19.  
  20. new msgcvar_method
  21. new Text_Msg, WinningTeam
  22. new Trie: tc
  23.  
  24. public plugin_init() {
  25. register_plugin("Win Messages Changer", "0.0.5", "Jhob94")
  26.  
  27. msgcvar_method = register_cvar("msg_method", "0") // 0 = Print_Center | 1 = HUD
  28.  
  29. tc = TrieCreate()
  30. TrieSetCell(tc, "%!MRAD_terwin" , register_cvar("msg_t_win" , "A Terroristak nyertek ezt a kort"))
  31. TrieSetCell(tc, "%!MRAD_ctwin" , register_cvar("msg_ct_win" , "A Terror Elharitok nyertek ezt a kort"))
  32. TrieSetCell(tc, "%!MRAD_rounddraw" , register_cvar("msg_rounddraw" , "Ebben a korben nem nyert semelyik csapat"))
  33.  
  34. register_message(get_user_msgid("SendAudio"), "Messages_Audio")
  35.  
  36. Text_Msg = get_user_msgid("TextMsg")
  37. }
  38.  
  39. public Messages_Audio(Message_Index, Message_Dest, Index)
  40. {
  41. if(!Index)
  42. {
  43. new Audio[14], won_msg[120]
  44. get_msg_arg_string(2, Audio, charsmax(Audio))
  45.  
  46. if(TrieGetCell(tc, Audio, WinningTeam) && get_pcvar_string(WinningTeam, won_msg, charsmax(won_msg)))
  47. {
  48. if(get_msg_block(Text_Msg) == BLOCK_NOT)
  49. set_msg_block(Text_Msg, BLOCK_ONCE)
  50.  
  51. if(!get_pcvar_num(msgcvar_method))
  52. client_print(0, print_center, "%s", won_msg)
  53.  
  54. else
  55. {
  56. set_hudmessage(0, 250, 0, -1.0, 0.3, 0, 6.0, 12.0, _, _, -1)
  57. show_hudmessage(0, "%s", won_msg)
  58. }
  59.  
  60. return PLUGIN_HANDLED
  61. }
  62. }
  63.  
  64. return PLUGIN_CONTINUE
  65. }